【问题标题】:How can I add two orderers to the same channel?如何将两个订购者添加到同一个频道?
【发布时间】:2018-12-08 12:30:56
【问题描述】:

我正在尝试使用 Kafka 构建一个包含两个订单的网络。

在第一个网络示例中,有一个名为 ./script.sh 的脚本,它创建一个带有关联排序器的通道,该排序器运行以下命令:

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

我已经开始实施 Kafka。但我的问题是如何更改此命令以创建具有两个订单的频道? 还是有更好的方法来做到这一点?

【问题讨论】:

    标签: apache-kafka hyperledger-fabric channel


    【解决方案1】:

    您不向频道添加订购者。 一个orderer属于一个orderer组织。您可以定义一个排序组织可以服务的多个联盟。联盟的定义在 Orderer 组织的定义中提供。

    当您创建一个频道时,您可以定义它属于哪个联盟。您在频道中定义的成员必须是该联盟的一部分。

    因此,如果您定义了一个排序组织,并且其中有多个排序节点,它将通过联盟为其组织所属的所有渠道提供服务。

    考虑以下 configtx.yaml 的简化示例:

    ProfileForGenesisOrderer1:
        Orderer:
            Organizations:
                - *OrdererOrg1
        Consortiums:
            Consortium1:
                Organizations:
                    - *Org1
                    - *Org2
                    - *Org3
    
    ProfileForGenesisOrderer2:
        Orderer:
            Organizations:
                - *OrdererOrg2
        Consortiums:
            Consortium2:
                Organizations:
                    - *Org4
                    - *Org5
                    - *Org6
    
    ChannelOne:
        Consortium: Consortium1
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org1
                - *Org3
    
    ChannelOne:
        Consortium: Consortium2
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org6
                - *Org4
    

    属于 OrdererOrg1 的排序者将只为其 Consortium1 服务,因此为 ChannelOne 服务。 OrdererOrg2 也是如此。

    【讨论】:

      【解决方案2】:

      我也想为不同的组织有不同的订单。我正在第一个网络的 configtx.yaml 上尝试这个

      ProfileForGenesisOrderer1:
          Orderer:
              Organizations:
                  - *OrdererOrg1
          Consortiums:
              Consortium1:
                  Organizations:
                      - *Org1
      
      
      ProfileForGenesisOrderer2:
          Orderer:
              Organizations:
                  - *OrdererOrg2
          Consortiums:
              Consortium2:
                  Organizations:
                      - *Org2
      
      
      ChannelOne:
          Consortium: Consortium1
          Application:
              <<: *ApplicationDefaults
              Organizations:
                  - *Org1
      
      
      ChannelOne:
          Consortium: Consortium2
          Application:
              <<: *ApplicationDefaults
              Organizations:
                  - *Org2
      

      但我收到错误...恐慌:读取配置时出错:解析配置时:yaml:第 412 行:未找到预期的密钥 还有什么应该改变的工作?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-03-21
        • 1970-01-01
        • 1970-01-01
        • 2020-08-04
        • 1970-01-01
        • 1970-01-01
        • 2021-06-19
        • 1970-01-01
        相关资源
        最近更新 更多