Hyperledger Composer add a new peer

不打扰是莪最后的温柔 提交于 2019-12-08 09:14:29

问题


I am modifying existing docker-compose.yml, crypto-config.yaml and configtx.yaml to add a extra peer to the existing hyperledger composer sample, located under hlfv11 folder of the fabric-tools/fabric-scripts.

I regenerated required certificates and genesis block and it generates the peer container without any issue.

However I am having difficulty adding this peer to a channel. I modified startFabric.sh to join this peer to a channel, however I am getting an error with following message:

Error getting endorser client channel: endorser client failed to connect to peer1.org1.example.com:8051: failed to create a new connection: context deadline exceeded.

Can someone please help or advise?


回答1:


I was trying to join me additional peer to channel directly through PEER CHANELL JOIN command. It actually requires to fetch the channel through orderer on new peer and then it can join it.

Code update follows:

# Create the channel
docker exec peer0.org1.example.com peer channel create -o 
orderer.example.com:7050 -c composerchannel -f 
/etc/hyperledger/configtx/composer-channel.tx

# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_MSPCONFIGPATH= 
/etc/hyperledger/msp/users/Admin@org1.example.com/msp 
peer0.org1.example.com peer channel join -b composerchannel.block

# Create the channel
docker exec -e "CORE_PEER_MSPCONFIGPATH= 
/etc/hyperledger/msp/users/Admin@org1.example.com/msp" 
peer1.org1.example.com peer channel fetch config -o orderer.example.com:7050 
-c composerchannel

# Join peer1.org1.example.com to the channel.
docker exec -e "CORE_PEER_MSPCONFIGPATH= 
/etc/hyperledger/msp/users/Admin@org1.example.com/msp 
peer1.org1.example.com peer channel join -b composerchannel_config.block


来源:https://stackoverflow.com/questions/49924385/hyperledger-composer-add-a-new-peer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!