configtxgen,用于生成通道配置,具体有如下三种用法:

* 生成Orderer服务启动的初始区块(即系统通道的创世区块文件)

  • configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block

* 生成新建应用通道的配置交易(即用于创建应用通道的配置交易文件)

  • configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel

* 生成锚节点配置更新文件

  • configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP

configtxgen代码分布在common/configtx/tool目录

  • localconfig/config.go,configtx.yaml配置文件相关的结构体及方法。