I am trying out the fabric-samples balance-transfer example, I tried to create a new channel with the below commands. The channel gets created but when I try to join the peer to the channel I get the below error. Can anyone suggest the step I am missing or going wrong
[client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: Cannot create ledger from genesis block, due to LedgerID already exists)
Command I used to create a new channel Config
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel.tx -channelID channel1
REST Call I am using to create the channel
curl -s -X POST http://localhost:4000/channels -H "authorization: Bearer XXXXXX" -H "content-type: application/json" -d '{ "channelName":"channel1", "channelConfigPath":"../artifacts/channel/channel.tx" }'
REST Call I am using to join the channel
curl -s -X POST http://localhost:4000/channels/channel1/peers
-H "authorization: Bearer XXXXX" -H "content-type: application/json" -d '{ "peers": ["peer1","peer2"] }'
In most instances, Cannot create ledger from genesis block, due to LedgerID already exists
, indicates that the peers have already joined the channel.
A quick way to test this, if you have instantiated chaincode on the peers, is to do a query on the ledger using one of the peers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With