Hyperledger fabric Hyperledger结构网络-使用JAVA sdk-创建通道时出错 环境: 马科斯:10.13.6 戈兰:1.11.8 Hyperledger结构:1.4 Java:1.8 说明:

Hyperledger fabric Hyperledger结构网络-使用JAVA sdk-创建通道时出错 环境: 马科斯:10.13.6 戈兰:1.11.8 Hyperledger结构:1.4 Java:1.8 说明:,hyperledger-fabric,hyperledger,Hyperledger Fabric,Hyperledger,我试着开一辆出租车 我可以使用默认配置正常部署和运行应用程序。 然后我在configtx.yaml中做了一些更改(只是一些关于生成块的规则),并生成二进制工具configtxgen,然后我使用: /configtxgen-profile twoorgorsorderergenesis-outputBlock genesis.block /configtxgen-profile TwoOrgsChannel-outputCreateChannelTx channel.tx-channelID m

我试着开一辆出租车

我可以使用默认配置正常部署和运行应用程序。 然后我在
configtx.yaml
中做了一些更改(只是一些关于生成块的规则),并生成二进制工具
configtxgen
,然后我使用:

  • /configtxgen-profile twoorgorsorderergenesis-outputBlock genesis.block
  • /configtxgen-profile TwoOrgsChannel-outputCreateChannelTx channel.tx-channelID mychannel
用于重新生成
channel.tx
genesis.block
的命令

我使用这些新文件启动结构网络,并按照的步骤操作,但在创建通道时出现以下错误:

*org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel, send transaction failed on orderer OrdererClient{id: 4, channel: mychannel, name: orderer.example.com, url: grpc://localhost:7050}. Reason: Channel mychannel orderer orderer.example.com status returned failure code 400 (BAD_REQUEST) during orderer next
    
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel orderer orderer.example.com status returned failure code 400 (BAD_REQUEST) during orderer next*
orderer容器的日志显示:

2020-08-26 10:25:33.469 UTC [orderer.common.broadcast] ProcessMessage -> WARN 009 [channel: mychannel] Rejecting broadcast of config message from 192.168.0.1:56440 because of error: error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating DeltaSet: attempted to set key [Value]  /Channel/Application/Org1MSP/AnchorPeers to version 1, but key does not exist


有人知道解决方案吗?

你也必须像脚本上说的那样更新你的锚节点

cryptogen generate --config=./crypto-config.yaml
mkdir config
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./config/genesis.block
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./config/channel.tx -channelID mychannel
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./config/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./config/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP

您可以找到脚本的详细信息,并且必须取消注释这些行。

您还必须更新您的锚节点,就像他们在脚本中所说的那样

cryptogen generate --config=./crypto-config.yaml
mkdir config
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./config/genesis.block
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./config/channel.tx -channelID mychannel
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./config/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./config/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP

您可以找到有关脚本的详细信息,并且必须取消注释这些行。

谢谢您的回答,但在运行脚本后,我仍然收到此错误。我怀疑configtxgen是否有问题?比如版本问题?是的,这可能是个问题。您可以使用Hyperledger Fabric 1.4.1 network从此处修复此问题:谢谢您的回答,但在运行脚本后,我仍然会遇到此错误。我怀疑configtxgen是否有问题?比如版本问题?是的,这可能是个问题。您可以从这里使用Hyperledger Fabric 1.4.1网络解决此问题: