fabric-samples/asset-transfer-basic/rest-api-go/main.go
Basil K Y b2de360e1c
REST api added for asset transfer in Golang (#836)
* 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>
2022-12-14 09:16:09 +01:00

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))
}