fabric2.0局域网多机版锚节点更新

fabric局域网多机链管理目录

  1. 《局域网环境、多机部署Fabric2.x版本(RAFT共识算法)+ 通道创建》

  2. 《fabric2.0局域网多机版链码部署、调用、升级》

  3. 《fabric2.0局域网多机版锚节点更新》

锚节点更新

  • 锚节点是一个peer节点

  • 那么锚节点和普通peer节点的区别就是
    在一个网络中,有多个组织,每个组织有多个peer节点,组织和组织之间需要通信,那么每个组织中选取一个peer节点作为代表,这个peer节点的代表就是锚节点

  • 锚节点的职责就是代表当前这个组织,和其他的组织进行通信。
    我们可以在配置文件中指定锚节点,任意的peer节点都有资格成为锚节点,一个组织最多有一个锚节点。

  • 本例中,我们选择peer0作为锚节点进行更新。操作如下:

生成组织org的锚节点文件(orderer主机)

[root@localhost fabric]# configtxgen -profile channel-2 -outputAnchorPeersUpdate ./channel-artifacts/channel-2_org.tx -channelID channel-2 -asOrg orgMSP
2021-05-14 14:47:57.401 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2021-05-14 14:47:57.440 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /data/fabric/configtx.yaml
2021-05-14 14:47:57.440 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2021-05-14 14:47:57.442 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update

  • 解析:

    configtxgen 
    	-profile channel-2  通道名
    	-outputAnchorPeersUpdate ./channel-artifacts/channel-2_org.tx  生成的锚节点文件位置及文件名
    	-channelID channel-2  通道名
    	-asOrg orgMSP   组织1的MSP
    
  • 多个组织需多次执行命令,如:

    configtxgen -profile channel-2 -outputAnchorPeersUpdate ./channel-artifacts/${org_name}.tx -channelID channel-2 -asOrg ${org_name}MSP
    
    

复制至锚节点主机peer0

scp ./channel-artifacts/channel-2_org.tx root@192.168.1.26:/data/fabric/channel-artifacts/

更新锚节点(peer0执行)

[root@localhost fabric]# docker exec cli peer channel update -o orderer.test.com:7050  --ordererTLSHostnameOverride orderer.test.com  -c channel-2 -f ./channel-artifacts/channel-2_org.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/test.com/msp/tlscacerts/tlsca.test.com-cert.pem 
2021-05-14 06:58:26.992 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2021-05-14 06:58:26.998 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2021-05-14 06:58:26.998 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-05-14 06:58:27.012 UTC [channelCmd] update -> INFO 004 Successfully submitted channel update

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值