Hyperledger fabric hyperledger结构中configtx.yaml中的配置文件部分是什么 TwoOrgSorderGenesis:

Hyperledger fabric hyperledger结构中configtx.yaml中的配置文件部分是什么 TwoOrgSorderGenesis:,hyperledger-fabric,hyperledger-composer,Hyperledger Fabric,Hyperledger Composer,在这个文件中,我们配置了genesis block,您可以实现它来构建自己的网络,因此让我们深入了解一些细节 在组织的领域中: 看起来像这样 TwoOrgsOrdererGenesis: <<: *ChannelDefaults Orderer: <<: *OrdererDefaults Organizations: - *OrdererOrg

在这个文件中,我们配置了genesis block,您可以实现它来构建自己的网络,因此让我们深入了解一些细节

组织的领域中: 看起来像这样

TwoOrgsOrdererGenesis:
        <<: *ChannelDefaults
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *Org1
                    - *Org2

    TwoOrgsChannel:
        Consortium: SampleConsortium
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org1
                - *Org2
            Capabilities:
                <<: *ApplicationCapabilities
在这里,我们用它的对等体定义我们的组织,并将这些组织的加密材料的链接提供给我们的结构。 因此,在本例中,我们在文件顶部有3个组织—订购者组织和2个其他对等组织—您可以注意到以下内容

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

- &Org1
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: Org1MSP

    # ID to load the MSP definition as
    ID: Org1MSP

    MSPDir: crypto-config/peerOrganizations/org1.example.com/msp

    AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org1.example.com
          Port: 7051

- &Org2
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: Org2MSP

    # ID to load the MSP definition as
    ID: Org2MSP

    MSPDir: crypto-config/peerOrganizations/org2.example.com/msp

    AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org2.example.com
          Port: 7051
这是订购方组织的配置,我们向会员服务提供商提供id,会员服务提供商是一个处理所有加密操作的框架—签名、验证、发布和链接—我们将其与文件系统MSPDir上该组织的加密材料所在地相链接

以下对等组织Org1和Org2遵循相同的结构,不同的是它们必须包含在锚定对等体中,锚定对等体允许您的组织对等体与其他组织对等体通信,这是与多个组织保持数据同步的主要点,因此,我们必须在下一节中为每个组织定义锚节点

Name: OrdererOrg
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/example.com/msp
现在移动到文件中的另一部分,即订购者: 看起来像

AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org1.example.com
          Port: 7051
如果您注意到订购者:&orderDefaults这是一个包含以下设置的别名,因此我们可以在配置文件中使用它,本节后面将对此进行解释

Orderer: &OrdererDefaults

# Orderer Type: The orderer implementation to start
# Available types are "solo" and "kafka"
OrdererType: solo

Addresses:
    - orderer.example.com:7050

# Batch Timeout: The amount of time to wait before creating a batch
BatchTimeout: 2s

# Batch Size: Controls the number of messages batched into a block
BatchSize:

    # Max Message Count: The maximum number of messages to permit in a batch
    MaxMessageCount: 10

    # Absolute Max Bytes: The absolute maximum number of bytes allowed for
    # the serialized messages in a batch.
    AbsoluteMaxBytes: 99 MB

    # Preferred Max Bytes: The preferred maximum number of bytes allowed for
    # the serialized messages in a batch. A message larger than the preferred
    # max bytes will result in a batch larger than preferred max bytes.
    PreferredMaxBytes: 512 KB

Kafka:
    # Brokers: A list of Kafka brokers to which the orderer connects
    # NOTE: Use IP:port notation
    Brokers:
        - 127.0.0.1:9092

# Organizations is the list of orgs which are defined as participants on
# the orderer side of the network
Organizations:
这意味着我们使用solo消息服务器,它适用于开发,但不适用于生产。我们在生产环境中使用kafka

    OrdererType: solo
这里的订购者地址我们只有一个订购者,但在实际生产中,我们可以有多个订购者,因此您可以在这里提供it地址

Addresses:
    - orderer.example.com:7050
在本节中,我们定义了何时创建新块,因此它取决于您的业务用例,因此您可以依赖于创建新块的时间,即BatchTimeoutBatchSize该块应持有多少事务,甚至该块的最大大小,仔细更改这些值以满足您的需求需要

卡夫卡: #代理:订购方连接到的卡夫卡代理列表 #注意:使用IP:port表示法 经纪人: -127.0.0.1:9092

如果您使用的是kafka,则将使用此配置,并且在生产中您将有多个代理,因此请提供代理的IP地址

最后,配置文件部分:

BatchSize:

    # Max Message Count: The maximum number of messages to permit in a batch
    MaxMessageCount: 10

    # Absolute Max Bytes: The absolute maximum number of bytes allowed for
    # the serialized messages in a batch.
    AbsoluteMaxBytes: 99 MB

    # Preferred Max Bytes: The preferred maximum number of bytes allowed for
    # the serialized messages in a batch. A message larger than the preferred
    # max bytes will result in a batch larger than preferred max bytes.
    PreferredMaxBytes: 512 KB
配置文件:
两个组织或地区:
能力:

你能解释一下应用程序:部分的用途吗?
Profiles:

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