mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
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>
26 lines
740 B
Go
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))
|
|
}
|