What does each definition in configtx.yaml means i

2020-05-29 09:15发布

This is related to Hyperledger fabric v1.0 network topology. From the example, configtx.yaml contains following definitions:

Profiles:

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

There are two main sections.

  1. TwoOrgsOrdererGenesis This defines the orderer service and the genesis block details.
  2. TwoOrgsChannel This defines the channel details. Such as how many organization/entity are going to be part of the channel.

What I understood from the documentation is Consortiums section defines what are the organizations/entities belongs to a Consortium.

My questions:

  1. What is the role of Consortium?
  2. Can a Consortium entity would have peer nodes running for it's own?
  3. If yes, how to configure in this yaml file?
  4. What is the meaning of <<: line?
  5. What is Application in this context?
  6. Can I define multiple profiles in this yaml file?

appreciate if anyone can explain in details.

3条回答
虎瘦雄心在
2楼-- · 2020-05-29 09:36

to reply to "Can I define multiple profiles in this yaml file?" the answer is yes. As you can see in this sample file, multiple profiles are here defined.

Profiles are used to defines the configuration of the genesis block and to define the first channel configuration transaction. In the code that you provide TwoOrgsOrdererGenesis should be used as parameter for the configtxgen command

configtxgen -profile SampleSingleMSPSolo -channelID sys-channel -outputBlock ./channel-artifacts/genesis.block

while the second is used to generate the artifacts for the channel transaction

configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID channel-name

In the above file you can check some different configurations... I think it is a good starting point to understand the network configuration which is still something I'm trying to fully figure out.

查看更多
\"骚年 ilove
3楼-- · 2020-05-29 09:49

My questions:

What is the role of Consortium?

A consortium consists of organizations. And organization contains peers or orderer. one channel is matched with one consortium but one consortium can be matched many consortiums.

Can a Consortium entity would have peer nodes running for it's own? If yes, how to configure in this yaml file?

No, but if you want to define consortium, you have to get MSPs about organizations.

What is the meaning of <<: line?

It's a YAML grammar.

What is Application in this context?

channel application like Node.js Application. But now My channel works without the section.

Can I define multiple profiles in this yaml file?

sorry, I don't understand what you want to define profile for.

查看更多
祖国的老花朵
4楼-- · 2020-05-29 09:51

Regarding the question "What is the meaning of <<: line?"

yaml files syntax :-

The & marks an alias for the node (in your example &default aliases the development node as "default") and the * references the aliased node with the name "default". The <<: inserts the content of that node.

This type reference are used when - Repeated nodes (objects) are first identified by an anchor (marked with the ampersand - “&”), and are then aliased (referenced with an asterisk - “*”) thereafter.

查看更多
登录 后发表回答