根据配置生成创始块文件和通道文件

configtxgen的参数

-profile #指定配置文件  这个队友的文件是configtx.yaml中的profile中的区块名字。

-outputBlock  #生成区块,在本地生成对应文件 再取一个名字

例如:

  configtxgen -profile xxx -outputBlock ./genesis.block  #后缀是block

然后将生成的创世区块文件需要放入到一个目录里面方便docker-conpose来使用

mkdir channel-artifacts  #需要放在这个文件里面

configtxgen -profile 通道文件名字  -outputCreateChannelTx channel.tx#后缀是tx

                  #还得有个channelID,就是给通道指定一个名字

              -channelID xxx  #和配置中的channelID无关以这个为主

还有一个锚节点的更新文件,可选可以不选:

  configtxgen -profile 通道名字  -ouputAncharPeer  文件名#一般看什么组织后面添加

                        组织名字anchors.tx

           -channelID 属于某个通道 #还要添加指定的通道地址

           -asOrg  所属组织名  #添加所属的组织名

原文地址:https://www.cnblogs.com/beautiful7/p/12865421.html