fabric-samples/asset-transfer-basic/rest-api-go/main.go
Mark S. Lewis 42b9b60ebc Update Go gRPC dependency
grpc.Dial() is (soon to be) deprecated in current gRPC versions. Use grpc.NewClient() instead.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-04-24 16:24:37 +09:00

26 lines
740 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: "dns:///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))
}