HyperledgerHandsOn/trade-finance-logistics

Creation of genesis block needs a different channel id

Closed this issue · 3 comments

Hello, it's me again. I followed your book and it was very clear in all the steps and more useful than the docs in getting started with fabric

I got an error a few days back, an error while passing nodejs commands to the blockchain (can't recollect which one but i guess it is channel/create or channel/join)

After many days of hunting around, solved it from the below link.

48 PM
@GowriR Thanks, changing the channel name fix the issue... very strange !

@antitoine Try creating the genesis.block and chaneel.tx with different channel names - i had a similar error a few days back
antitoine August 2, 2018 12:22 PM
Anyone can help me on this error ? Orderer Server Status Code: (400**) BAD_REQUEST**. Description: error authorizing update: error validating ReadSet: existing config does not contain element for [Group] /Channel/Application/Org1MSP but was in the read set

https://stackoverflow.com/questions/51590202/channel-creation-fails-in-hyperledger-fabric-v1-2

Could you help me understand why this happens and why creating the genesis.block with a different channel ID (in the book - no channel ID was specified), from the channel.tx creation, solves the issue?

Thanks

You are supposed to provide the application channel ID during generation as follows (this is described both in the book and in the READMEs here): ./trade.sh generate -c <channel-id>.

Perhaps you are referring to this line: https://github.com/HyperledgerHandsOn/trade-finance-logistics/blob/master/network/trade.sh#L496?

  • the genesis block is created for the orderer channel, which is a "system" channel (distinct from application channels, like tradechannel in our example.) That's why we don't specify a channel ID parameter in the above line. It defaults to testchainid, as you will discover if you look at genesis.block and in the logs. But do note that your orderer channel ID and your application channel ID must be different (the other commenter was right in noting that.)
  • our example doesn't have any orderer configuration (or orderer channel) variations; we wanted to keep things somewhat simple. As you can see, just walking through a basic application consumed many pages, and there are so many ways to configure Fabric that one book (covering both theory and practice) wouldn't do justice to that topic. Perhaps, if there's another edition of the book, we could add such schenarios. For now, if you want to experiment, use our example app as the basis, and check out the Fabric docs for more clues.

Yes, I have observed the testchainid getting created if i do not give one.

Thanks so much, it is much clearer now.

Please close this issue if you have no more concerns.