【问题标题】:How to have a consortium with 1 organization in a network with two organizations?如何在具有两个组织的网络中建立一个具有 1 个组织的联盟?
【发布时间】:2020-02-09 02:36:08
【问题描述】:

我正在搭建一个由两个组织组成的服务器(后面是3个),如下链接所示:https://hyperledger-fabric.readthedocs.io/en/release-1.4/network/network.html

但是,联盟不能包含两个组织(Org1 和 Org2),而只能包含组织 1 (Org1),如下图所示:https://imgur.com/a/gcBcINq

在我的 configtx.yaml 文件中,我将 SampleConsortium 值设置如下:

Profiles:

    TwoOrgsOrdererGenesis:
        <<: *ChannelDefaults
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *Org1
                    # - *Org2
    TwoOrgsChannel:
        Consortium: SampleConsortium
        <<: *ChannelDefaults
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org1
                - *Org2
            Capabilities:
                <<: *ApplicationCapabilities

所以我定义了一个具有单一组织的联盟:Org2。

但是,当使用代码行实例化我的频道时

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example. com-cert.pem

屏幕显示一个错误告诉我:错误:出现意外状态:BAD_REQUEST -- 尝试包含一个不在联盟中的成员

您是否有想法通过在我的联盟中只有一个组织来生成我的频道?

非常感谢您的回答:)

PS:这是我第一个使用超级账本结构的项目,所以我对这项技术仍然“新”。但是,在我看来,没有迹象表明一个财团不应拥有至少 2 个组织。

【问题讨论】:

  • 从 TwoOrgschannel 配置文件中删除 Org2 详细信息

标签: hyperledger-fabric blockchain hyperledger


【解决方案1】:

您必须在 TwoOrgsChannel 个人资料中评论 Org2。然后您将能够在完成此操作后创建我的频道,您可以通过更新频道配置来添加 Org2 以获取更多详细信息,您可以参考阅读文档https://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html

【讨论】:

    【解决方案2】:

    非常感谢,您的解决方案奏效了。但是,我只能在我的频道中添加 Org1 组织。如果我对 Org2 行发表评论,则会出现错误

    Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied
    

    虽然我的 configtx.yaml 文件如下所示:

    Profiles:
    
        TwoOrgsOrdererGenesis:
            <<: *ChannelDefaults
            Orderer:
                <<: *OrdererDefaults
                Organizations:
                    - *OrdererOrg
                Capabilities:
                    <<: *OrdererCapabilities
            Consortiums:
                SampleConsortium:
                    Organizations:
                        - *Org1
                        - *Org2
        TwoOrgsChannel:
            Consortium: SampleConsortium
            <<: *ChannelDefaults
            Application:
                <<: *ApplicationDefaults
                Organizations:
                   # - *Org1
                     - *Org2
                Capabilities:
                    <<: *ApplicationCapabilities
    
    

    【讨论】:

    • 我自己解决了这个问题。我正在运行命令通过 peer0.org1(这是默认设置)创建频道!所以我通过放置用户 peer0.org2 之一来指定命令变量!它奏效了!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多