how to use this to create channel at fabric2.4 without orderer system channel
jianlu8023 opened this issue · 5 comments
when i use this sdk to create channel at fabric2.4.3 test-network has err mains without orderer system channel
I think you should firstly start an oredering node. Orderer is the one of key parts in Hyperledger Fabric, and it should be created earlier, than channel, because it establishes a consensus on the order of transactions across the entire network, while channel is the place where transactions occurs.
I think you should firstly start an oredering node. Orderer is the one of key parts in Hyperledger Fabric, and it should be created earlier, than channel, because it establishes a consensus on the order of transactions across the entire network, while channel is the place where transactions occurs.
this is my steps:
- use network.sh start test-network environment command: ./network.sh up -ca -s couchdb
- use go sdk to create a channel
then i meet this problem
i want to study use go-sdk to create a channel and other operation such as install chaincode
You can use ./network.sh up createChannel
and it will create channel with name mychannel
, and install chaincode there like:
peer chaincode package basic.tar.gz --path path/to/your/chaincode --lang golang --label basic_1.0
&&
peer chaincode install basic.tar.gz
You can use
./network.sh up createChannel
and it will create channel with namemychannel
, and install chaincode there like:
peer chaincode package basic.tar.gz --path path/to/your/chaincode --lang golang --label basic_1.0
&&
peer chaincode install basic.tar.gz
yes i know but i want to use sdk to operation environment
Then you should firstly initialize fabric sdk:
fsdk, err := fabsdk.New(config.FromFile("config.yaml")) if err != nil { panic(err) } // defer close clientContext := sdk.Context()
and then, create a channel
channelClient, err := channel.New(clientContext) if err != nil { panic(err) } err = channelClient.CreateChannel(channel.Request{ Name: "mychannel", Orderer: "orderer.example.com", }) if err != nil { panic(err) }