【问题标题】:Hyperledger Fabric network - using JAVA sdk - ERROR while creating channelHyperledger Fabric 网络 - 使用 JAVA sdk - 创建通道时出错
【发布时间】:2020-12-15 09:13:12
【问题描述】:

环境:

  • MacOS:10.13.6
  • Golang:1.11.8
  • Hyperledger Fabric:1.4
  • Java:1.8

说明:

我尝试运行official JavaSDK Fabric app example

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

  • ./configtxgen -profile TwoOrgsOrdererGenesis -outputBlock genesis.block
  • ./configtxgen -profile TwoOrgsChannel -outputCreateChannelTx channel.tx -channelID mychannel

重新生成channel.txgenesis.block 的命令。

我使用这些新文件启动fabric网络,按照this page的步骤,但是在创建通道时出现如下错误:

*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

有人知道解决办法吗?

【问题讨论】:

    标签: hyperledger-fabric hyperledger


    【解决方案1】:

    您也必须像他们在脚本中所说的那样更新您的 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 脚本中找到详细信息,并且必须取消注释掉这些行。

    【讨论】:

    猜你喜欢
    • 2018-08-07
    • 1970-01-01
    • 2019-06-11
    • 1970-01-01
    • 2018-12-30
    • 1970-01-01
    • 2019-07-26
    • 2019-01-14
    • 2019-05-21
    相关资源
    最近更新 更多