搭建Fabric网络(三)artifacts是怎么生成的:cryptogen和configtxgen

在first-network里,./byfn.sh generate可以生成artifacts文件。

generate参数其实是使用了cryptogen和configtxgen这两个工具,这两个工具分别生成不同的artifacts文件。

这里主要介绍详细介绍这两个工具的配置。

 

1, cryptogen

../bin/cryptogen generate --config=./crypto-config.yaml 

 执行成功之后会显示

org1.example.com
org2.example.com

cryptogen工具生成了crypto-config文件夹,这个文件包含了各个节点的证书。

 

 

 

这些文件在以后我们都会用到。

 

创建Channel的config transaction

export CHANNEL_NAME=mychannel  && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME

 然后得到如下输出

2018-05-11 14:46:57.861 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-05-11 14:46:57.869 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-05-11 14:46:57.974 CST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2018-05-11 14:46:57.996 CST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2018-05-11 14:46:58.042 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 005 Writing new channel tx

 

指定Anchor节点

../bin/configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP

../bin/configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP

然后得到如下输出

2018-05-11 14:49:52.061 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-05-11 14:49:52.079 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2018-05-11 14:49:52.079 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

 

转载于:https://www.cnblogs.com/13579net/p/8919240.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值