Join Org4 to the Channel

Copy all files necessary files: org4-artifacts and channel_artifacts files to the server4/fabric-samples directory

Inside the org4-artifacts directory open a new terminal to set container for org4 peers and CLI:

docker-compose -f server4-cli.yaml up -d 

Run CLI container:

docker exec -it org4cli bash

Export the two key environment variables: ORDERER_CA and CHANNEL_NAME:

export ORDERER_CA=/opt/gopath/src/ && export CHANNEL_NAME=mychannel

To retieve mychannel genesis block:

peer channel fetch 0 mychannel.block -o -c $CHANNEL_NAME --tls --cafile $ORDERER_CA  

Join peer into mychannel block:

peer channel join -b mychannel.block

For adding second peer of org4:

export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/ && export peer channel join -b mychannel.block