fabric 关于追加新组织结构

fabric 追加组织
摘要由CSDN通过智能技术生成

用configtxlator+cli+sdk

最近对动态追加组织Org3MSP进行了确认(cli+sdk),以下是所有的步骤。(过程粗略,详细部分自己学习研究,只是提供思想)
cli用来生成pb文件,sdk用来做签名
1.取得e2e例子的mychannel的配置定义
CORE_PEER_LOCALMSPID="Org1MSP" 
peer channel fetch config 'mychannel.pb' -o 'orderer0.example.com:7050' -c 'mychannel'
2.取得系统channel的配置定义
CORE_PEER_LOCALMSPID="OrdererMSP" 
peer channel fetch config 'syschannel.pb' -o 'orderer0.example.com:7050' -c 'testchainid'
3.生成新组织的所有密钥
做一个新的crypto-config.yaml文件,里面只有新组织的情报
通过下面命令,生成所有密钥文件
...../hyperledger/fabric/release/linux-amd64/bin/cryptogen generate --config=./crypto-config-neworg.yaml
4.做两个OrgMSPsample.json文件,分别用于普通channel和系统channel。两个的区别在于,系统channel有AnchorPeers和版本的定义
5.对于生成的密钥进行base64编码,并填写到OrgMSPsample.json里面。共牵涉3个项目如下。
admins ->../crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/admincerts/Admin@org3.example.com-cert.pem
root_certs ->../crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/cacerts/ca.org3.example.com-cert.pem
tls_root_certs ->../crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/tlscacerts/tlsca.org3.example.com-cert.pem
命令:cat xxxxx | base64 | sed ":a;N;s/\n//g;ta" 
6.参照fabric/examples/configtxupdate/例子,把普通channel和系统channel的差分pb文件做好,准备给sdk使用。
7.在sdk利用上面生成的查分pb文件,对系统channel进行更新(向Consortiums追加org,用OrderMSP的Admin用户提交更新)。
9.在sdk利用上面生成的查分pb文件,对mychannel进行更新(向applicati

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值