mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
* REST api added for asset transfer in Golang Signed-off-by: Basil K Y <techiebasil@gmail.com> * add go.sum to git Signed-off-by: Basil K Y <techiebasil@gmail.com> * fix golint error Signed-off-by: Basil K Y <techiebasil@gmail.com> Signed-off-by: Basil K Y <techiebasil@gmail.com>
26 lines
733 B
Go
26 lines
733 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"rest-api-go/web"
|
|
)
|
|
|
|
func main() {
|
|
//Initialize setup for Org1
|
|
cryptoPath := "../../test-network/organizations/peerOrganizations/org1.example.com"
|
|
orgConfig := web.OrgSetup{
|
|
OrgName: "Org1",
|
|
MSPID: "Org1MSP",
|
|
CertPath: cryptoPath + "/users/User1@org1.example.com/msp/signcerts/cert.pem",
|
|
KeyPath: cryptoPath + "/users/User1@org1.example.com/msp/keystore/",
|
|
TLSCertPath: cryptoPath + "/peers/peer0.org1.example.com/tls/ca.crt",
|
|
PeerEndpoint: "localhost:7051",
|
|
GatewayPeer: "peer0.org1.example.com",
|
|
}
|
|
|
|
orgSetup, err := web.Initialize(orgConfig)
|
|
if err != nil {
|
|
fmt.Println("Error initializing setup for Org1: ", err)
|
|
}
|
|
web.Serve(web.OrgSetup(*orgSetup))
|
|
}
|