Hyperledger Fabric网络-使用JAVA SDK-创建频道时出错

问题描述

环境:

  • MacOS:10.13.6
  • Golang:1.11.8
  • 超级账本面料:1.4
  • Java:1.8

说明:

我尝试运行official JavaSDK Fabric app example

我可以使用认配置正常部署和运行该应用程序。 然后,我在i <- is.na(df$R1) | (is.na(df$RC) | df$RC != "ACC") df1 <- df[!i,] df2 <- df[i,] 中进行一些更改(只是一些有关生成块的规则)并生成二进制工具configtx.yaml,然后使用:

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

用于重新生成./configtxgen -profile TwoOrgsChannel -outputCreateChannelTx channel.tx -channelID mychannelchannel.tx的命令。

我使用这些新文件来启动结构网络,并遵循this page的步骤,但是在创建频道时出现以下错误

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*

有人知道解决方案吗?

解决方法

您也必须像在脚本中所说的那样更新Anchor伙伴。

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

您可以在build.sh脚本中找到详细信息,而不必取消注释这些行。