首页 > 解决方案 > 每个频道的同意者子集 - 每个频道的组织的单独订购者

问题描述

我必须找到一种方法来为每个频道定义同意者的子集。

主要目的是为每个渠道分开组织的订购者。

例如:

* I have Org1 and Org2:
        ** Org1 has orderes: orderer11, orderer 12
        ** Org2 has orderer: 21, orderer 22
* I want to create system channel which contains EtcdRaft consenter with all 4 orderers.
* I want to create 2 application channels, each one of them will contain EtcdRaft with 1 orderer from each org in the following way:
        ** channel1 with orderer11 and orderer 21
        ** channel2 with orderer12 and orderer 22

我试图在 configtx.yaml 文件上配置理想的配置,但我所有的实验都失败了。

预期配置示例:

Profiles:
/** System Channel **/
    mychannel
        Organization: OrdererOrg
        Orderer:
            <<: *OrdererDefaults
                    OrdererType: etcdraft
                    EtcdRaft:
                Consenters:
                    - Host: orderer11.example.com
                    - Host: orderer12.example.com
                    - Host: orderer21.example.com
                    - Host: orderer22.example.com
        Consortiums:
            Organizations:
                - *org1
                - *org2
/** Application Channels **/
    channel1
        Orderer:
            <<: *OrdererDefaults
                    OrdererType: etcdraft
                    EtcdRaft:
                Consenters:
                    - Host: orderer11.example.com
                    - Host: orderer21.example.com
        Consortiums:
            Organizations:
                - *org1
                - *org2
    channel2
        Orderer:
            <<: *OrdererDefaults
                    OrdererType: etcdraft
                    EtcdRaft:
                Consenters:
                    - Host: orderer12.example.com
                    - Host: orderer22.example.com
        Consortiums:
            Organizations:
                - *org1
                - *org2

如何应用预期的配置?

标签: hyperledger-fabrichyperledger

解决方案


排序服务使用系统通道作为模板来创建应用程序通道。系统频道中定义的排序服务节点成为新频道的默认同意者集,排序服务的管理员成为频道的排序者管理员。

所以你Orderer在 Profile 应用程序通道部分定义是没用的

但是可以通过更新应用程序通道配置在通道中添加或删除排序节点

因此,如果您想为每个通道使用单独的订购者,在创建应用程序通道后,删除您的应用程序通道配置的同意者集,您可以参考https://hyperledger-fabric.readthedocs.io/en/release-2.2/config_update.html

https://kctheservant.medium.com/add-an-orderer-to-a-running-raft-based-orderer-cluster-b6a432da138c

我在 1.4.2 版成功使用了每个频道的单独订购者,我认为 2.3.x 版更容易。因为您可以在没有系统通道的情况下设置您的结构网络。


推荐阅读