Hyperledger fabric Hyperledger结构:“;验证读取集时出错:读取集在版本1时应为key[Group]/Channel/Application,但获得版本3“;

Hyperledger fabric Hyperledger结构:“;验证读取集时出错:读取集在版本1时应为key[Group]/Channel/Application,但获得版本3“;,hyperledger-fabric,Hyperledger Fabric,我在这里面临一个问题,我用一个组织ORG1(使用orderer Order1)创建了一个通道,然后通过使用cli命令更新通道配置块添加了ORG2和ORG3: peer channel update -f nada_update_in_envelope.pb -c $CHANNEL_NAME -o orderer.example.com:7050 --tls --cafile $ORDERER_CA 我想做的下一件事是为每个组织添加一个锚节点。 通过为每个组织的锚节点运行: peer chann

我在这里面临一个问题,我用一个组织ORG1(使用orderer Order1)创建了一个通道,然后通过使用cli命令更新通道配置块添加了ORG2和ORG3:

peer channel update -f nada_update_in_envelope.pb -c $CHANNEL_NAME -o orderer.example.com:7050 --tls --cafile $ORDERER_CA
我想做的下一件事是为每个组织添加一个锚节点。 通过为每个组织的锚节点运行:

peer channel update -o orderer1.example.com:7050 -c mainchannel -f channel-artifacts/org1/channels/mainchannel/mainchannel/ORG1MSPanchors.tx --tls --cafile <path>

根本原因是您的/Channel/Application版本在2次添加新组织后已升级到3。但在“configtxgen--help”中,您可以看到以下内容:

 -outputAnchorPeersUpdate string
        [DEPRECATED] Creates a config update to update an anchor peer (works only with the default channel creation, and only for the first update)
因此,对于非首次更新,您必须自己编辑ORG1MSPanchors.tx:

configtxlator proto_decode --input ./channel-artifacts/ORG1MSPanchors.tx --type common.Envelope >channel-artifacts/ORG1MSPanchors.json
然后将“payload.data.config\u update.read\u set.groups.Application.version”和“payload.data.config\u update.write\u set.groups.Application.version”更改为版本3,并重新编码:

 configtxlator proto_encode --input ./channel-artifacts/ORG1MSPanchors.json  --type common.Envelope >./channel-artifacts/ORG1MSPanchors.tx
现在,您可以使用“对等通道更新”来更新ORG1的锚节点

事实上,官方的步骤应该是

 configtxlator proto_encode --input ./channel-artifacts/ORG1MSPanchors.json  --type common.Envelope >./channel-artifacts/ORG1MSPanchors.tx