Error when installing channel: "Error: got unexpected status: BAD_REQUEST -- Unknown consortium name: SampleConsortium"

Error when installing channel: "Error: got unexpected status: BAD_REQUEST -- Unknown consortium name: SampleConsortium"

当我尝试安装频道时出现以下错误:

Error: got unexpected status: BAD_REQUEST -- Unknown consortium name: SampleConsortium

在订购者上我收到以下警告:

Rejecting broadcast of config message from 172.18.0.3:57490 because of error:Unknown consortium name: SampleConsortium

我没有以任何方式引用示例联盟,我无法在任何生成的通道工件中找到它,并且在 peer、orderer 和 cli 的日志中没有出现任何其他反馈。

我使用的是 1.4 版

我很乐意分享更多信息。

编辑 1:

我在 cli 上使用命令 create 时看到一些奇怪的东西我得到以下反馈:

[common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /etc/hyperledger/fabric/configtx.yaml

并且当看到config是configtx文件的默认模板。为什么要这样做?

联盟在名为 configtx.yaml 的文件中定义(特别是在 Profile 部分),该文件用于创建排序节点创世块并嵌入 docker -在订购者配置部分编写 yaml 文件。

当您执行 docker-compose up 时,此块将与名为 testchainid 的系统通道一起硬编码到排序器中。要验证相同,请按 docker logs -f <orderer.example.com or whatever the url is>.

查找 docker 日志

看起来您的 configtx 文件配置有误,请参考 this 文件以获得更好的参考。

具体来说,你可能写了类似

的东西
Profiles:
    mychannel:
        Consortium: SampleConsortium
        Application:
           ...

并且错过了在 genesis 配置文件中定义 SampleConsortium,例如

Profile:
    TwoOrgGenesis:
        Consortiums:
            SampleConsortium:
                Organizations:
                    - <<: *org1
                      Policies:
                          ....

在 configtx 文件中进行必要的修改后,重新创建工件,包括 genesis.block、channel.tx、anchors.tx,然后重新启动网络。