hyperledger fabric中configtxgen工具使用

configtxgen主要功能

1、生成启动orderer需要的创世区块,并支持检查区块内容
2、生成创建应用通道需要的配置交易,并支持检查交易内容
3、生成锚点Peer的更新配置交易

configtxgen命令详解

-profile string :从configtx.yaml中查找到指定的profile来生成配置,默认为使用Sample-InsecureSolo
-channelID string :指定操作的通道名称,默认是testchainid
生成选项:
-outputBlock string :将初始区块写入指定文件
-outputCreateChannelTx string :将通道创建交易写入指定文件
-outputAnchorPeersUpdate string :创建更新锚点Peer的配置更新请求,需要同时使用 -asOrg 来指明组织身份
-asOrg string :以指明的组织身份执行更新配置交易(入更新锚节点)的生成,意味着写集合中包含了该组织有权限操作的键值
查看选项:
-inspectBlock string :打印指定区块文件中的配置信息
-inspectChannelCreateTx :打印通道创建交易文件中的配置更新信息

示例:

生成创世区块
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock orderer.genesis.block
查看通道配置
configtxgen -profile TwoOrgsOrdererGenesis -inspecBlock orderer.genesis.block
生成新建通道交易文件
configtxgen -profile TwoOrgsChannel -channelID channel -outputCreateChannelTx channel.tx
查看配置文件内容
configtxgen -profile TwoOrgsChannel -inspectChannelCreateTx channel.tx
生成锚点更新交易文件
configtxgen -profile TwoOrgsOrdererChannel -outputAnchorPeersUpdate Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值