一、更新org1的锚节点peer0
- 进入cli容器,命令:
docker exec -it fabric-cli /bin/bash
- 进入容器的tmp目录,命令:
cd /tmp
- 设置环境变量,使用org1-peer0身份
export org=1
export peer=0
export CORE_PEER_LOCALMSPID=Org${org}MSP
export CORE_PEER_ADDRESS=peer${peer}.org${org}.example.com:7051
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org${org}.example.com/users/Admin@org${org}.example.com/msp
export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org${org}.example.com/peers/peer${peer}.org${org}.example.com/tls/ca.crt
- 查看环境变量是否启用tls,命令
echo $CORE_PEER_TLS_ENABLED
,若输出true,则启用了tls;若输出false,没有启用tls - 若启用了tls,更新锚节点命令
peer channel update -c businesschannel -o orderer0.example.com:7050 -f channel-artifacts/Org1MSPanchors.tx --tls --cafile /etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/ca.crt
- 若没有启用tls,更新锚节点命令
peer channel update -c businesschannel -o orderer0.example.com:7050 -f channel-artifacts/Org1MSPanchors.tx
二、更新org2的锚节点
- 进入cli容器,命令:
docker exec -it fabric-cli /bin/bash
- 进入容器的tmp目录,命令:
cd /tmp
- 设置环境变量,使用org2-peer0身份
export org=2
export peer=0
export CORE_PEER_LOCALMSPID=Org${org}MSP
export CORE_PEER_ADDRESS=peer${peer}.org${org}.example.com:7051
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org${org}.example.com/users/Admin@org${org}.example.com/msp
export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org${org}.example.com/peers/peer${peer}.org${org}.example.com/tls/ca.crt
- 查看环境变量是否启用tls,命令
echo $CORE_PEER_TLS_ENABLED
,若输出true,则启用了tls;若输出false,没有启用tls - 若启用了tls,更新锚节点命令
peer channel update -c businesschannel -o orderer0.example.com:7050 -f channel-artifacts/Org2MSPanchors.tx --tls --cafile /etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/ca.crt
- 若没有启用tls,更新锚节点命令
peer channel update -c businesschannel -o orderer0.example.com:7050 -f channel-artifacts/Org2MSPanchors.tx