如何将两个订购者添加到同一个频道

如何将两个订购者添加到同一个频道

本文介绍了如何将两个订购者添加到同一个频道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to build a network with two orders using Kafka.

在第一个网络示例中,有一个名为 ./script.sh 的脚本,该脚本创建了一个通道,该通道具有运行此命令的关联订购者:

In the first network example there is a script named./script.sh that creates a channel with an associated orderer that runs this command:

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.但我的问题是如何更改此命令以创建具有两个订单的频道?或者有没有更好的方法来做到这一点?

I already started implementing Kafka. But my question is How can I change this command to create a channel with two orders?Or is there a better way to do this?

推荐答案

您不会将订购者添加到频道.订购者属于订购者组织.您可以定义一个订购者组织可以服务的多个联盟.联盟的定义在订购者组织的定义中提供.

You do not add orderers to channel.An orderer belongs to an orderer organization. You can define multiple consortium that an orderer organization can serve. The definition of consortium is provided inside the definition of the Orderer Organization.

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

When you create an channel, you define which consortium it belongs to. The members you define in the channel, needs to be a part of that consortium.

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

Hence, if you define an orderer organization and you have multiple orderer nodes in them, it will serve all channels that its organization is a part of via consortiums.

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

Consider the below simplified example of 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 也是如此.

An orderer belonging to OrdererOrg1 will only its Consortium1 hence serve ChannelOne. Same is the case for OrdererOrg2.

这篇关于如何将两个订购者添加到同一个频道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 05:53