Tools, FAQ, Tutorials:
Join Peer to BYFN Network Channel
How to join the default peer to a BYFN network Channel?
✍: FYIcenter.com
You can follow this tutorial to join the default peer to a BYFN network Channel.
In last tutorial, we have created a transaction file, channel.tx, that contains a transaction message to create a channel called "mychannel" on the BYFN network.
Now we need connect to the BYFN CLI container to submit it the running BYFN network.
1. Connect the FYBN CLI container:
$ docker exec -it cli bash bash-4.4#
2. Verify if the channel.tx file is deployed on the CLI container or not:
bash-4.4# ls -l channel-artifacts/ total 28 -rw-r--r-- 1 1000 1000 284 Apr 1 23:59 Org1MSPanchors.tx -rw-r--r-- 1 1000 1000 284 Apr 1 23:59 Org2MSPanchors.tx -rw-r--r-- 1 1000 1000 346 Apr 1 23:57 channel.tx -rw-r--r-- 1 1000 1000 12980 Apr 1 23:56 genesis.block
3. Submit transaction file, channel.tx, to create a channel:
bash-4.4# peer channel create -o orderer.example.com:7050 -c mychannel \
-f ./channel-artifacts/channel.tx --tls \
--cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto\
/ordererOrganizations/example.com/orderers/orderer.example.com/msp\
/tlscacerts/tlsca.example.com-cert.pem
[channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
[cli.common] readBlock -> INFO 002 Got status: &{NOT_FOUND}
[channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
[cli.common] readBlock -> INFO 004 Received block: 0
4. Verify the output file, mychannel.block, which contains the channel information:
bash-4.4# ls -l mychannel.block -rw-r--r-- 1 root root 15994 Apr 12 00:52 mychannel.block
5. Join the default peer to the "mychannel":
bash-4.4# peer channel join -b mychannel.block [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
6. Verify channels joined by the default peer:
bash-4.4# peer channel list [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized Channels peers has joined: mychannel
peer0.org1.example.com has joined the "mychannel".
⇒ Switch Default Peer on BYFN CLI Container
⇐ CORE_PEER_* Environment Variables on BYFN CLI
2020-09-30, ∼1382🔥, 0💬
Popular Posts:
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How to add request query string Parameters to my Azure API operation 2017 version to make it more us...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...
How to start Docker Daemon, "dockerd", on CentOS systems? If you have installed Docker on your CentO...
How To Truncate an Array in PHP? If you want to remove a chunk of values from an array, you can use ...