实验第六节——更新锚节点

一、更新org1的锚节点peer0

  1. 进入cli容器,命令:docker exec -it fabric-cli /bin/bash
  2. 进入容器的tmp目录,命令:cd /tmp
  3. 设置环境变量,使用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
  1. 查看环境变量是否启用tls,命令echo $CORE_PEER_TLS_ENABLED,若输出true,则启用了tls;若输出false,没有启用tls
  2. 若启用了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
  1. 若没有启用tls,更新锚节点命令
peer channel update -c businesschannel -o orderer0.example.com:7050 -f channel-artifacts/Org1MSPanchors.tx

二、更新org2的锚节点

  1. 进入cli容器,命令:docker exec -it fabric-cli /bin/bash
  2. 进入容器的tmp目录,命令:cd /tmp
  3. 设置环境变量,使用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
  1. 查看环境变量是否启用tls,命令echo $CORE_PEER_TLS_ENABLED,若输出true,则启用了tls;若输出false,没有启用tls
  2. 若启用了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
  1. 若没有启用tls,更新锚节点命令
peer channel update -c businesschannel -o orderer0.example.com:7050 -f channel-artifacts/Org2MSPanchors.tx
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值