Hyperledger fabric 单个订购方能否处理多个渠道?
单个订购者可以处理多个通道吗 这是订购方的.yaml配置:Hyperledger fabric 单个订购方能否处理多个渠道?,hyperledger-fabric,Hyperledger Fabric,单个订购者可以处理多个通道吗 这是订购方的.yaml配置: orderer_example_com: container_name: orderer.example.com image: hyperledger/fabric-orderer environment: - ORDERER_GENERAL_LOGLEVEL=debug - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - ORDERER_GENERAL_GENESIS
orderer_example_com:
container_name: orderer.example.com
image: hyperledger/fabric-orderer
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis1.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/crypto/orderer/msp
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/crypto/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/crypto/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/crypto/orderer/tls/ca.crt, /etc/hyperledger/crypto/peerOrg1/tls/ca.crt, /etc/hyperledger/crypto/peerOrg2/tls/ca.crt, /etc/hyperledger/crypto/peerOrg3/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderers
command: orderer
ports:
- 7050:7050
volumes:
- ./channel:/etc/hyperledger/configtx
- ./channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/crypto/orderer
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/crypto/peerOrg1
- ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/crypto/peerOrg2
- ./channel/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/:/etc/hyperledger/crypto/peerOrg3
networks:
chfn:
aliases:
- orderer.example.com
我为每个通道设置了1个genesis文件,并且属性医嘱者_GENERAL_GENESISFILE仅设置为其中一个。我应该为每个通道定义订购者吗?如果您查看configtx.yaml文件,该文件实际上包含所有要编码到订购服务生成块中的相关信息,例如在引导阶段定义所有已知组织的组织,这些组织可能会组成一个联盟来启动通道。事实上,configtxgen将与组织相关的加密材料编码到genesis块中,以便订购方能够验证尝试提交事务或连接以交付新块的对等方的身份
################################################################################
#
# Section: Organizations
#
# - This section defines the different organizational identities which will
# be referenced later in the configuration.
#
################################################################################
Organizations:
# SampleOrg defines an MSP using the sampleconfig. It should never be used
# in production but may be used as a template for other definitions
- &OrdererOrg
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: OrdererOrg
# ID to load the MSP definition as
ID: OrdererMSP
# MSPDir is the filesystem path which contains the MSP configuration
MSPDir: crypto-config/ordererOrganizations/example.com/msp
而这个genesis区块与用新通道创建的genesis区块无关。因此,对于您的问题,一个订购服务可以处理多个渠道,只要它们由熟悉的组织组成。您可以为configtxgen工具定义配置文件,以指定要编码为特定通道的联合体的组织列表,例如:
Orgs12Channel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2
可以定义Org1和Org3的附加通道。在所有订购服务的配置之后,它定义了联合体并列出了所有可以定义渠道的组织
OrdererGenesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
SampleConsortium:
Organizations:
- *Org1
- *Org2
- *Org3
对。我们可以单次订购多个频道。
但是我们应该有很多订单来保持系统可用。TL;DR:@Artem的回答是肯定的,Hyperledger结构中的订购服务可以处理多个渠道 订购方服务可能有多个节点,以提供由某些容错协议(如PAXOS、RAFT、*BFT等)实现的服务的恢复能力。对于Kafka订购方,我们目前支持崩溃容错 Fabric还支持一个拓扑模型,该拓扑模型具有多个不同的Order服务,每个服务都支持一组不重叠的通道
对等节点可以参与多个通道,这些通道可能由不同的订购方服务支持。订购服务已经由许多订购方节点组成,特别是出于这个原因,而如果您希望实现更高级别的保密性,则需要多个订购服务。
OrdererGenesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
SampleConsortium:
Organizations:
- *Org1
- *Org2
- *Org3