The main content of this article is as follows

  • Orderer configuration
  • Application configuration
  • Consortiums configuration
  • Formation block

Continue to look at configuration files.

Orderer configuration

Orderer configuration

Again, we are looking at the configuration of the system channel, not the configuration of the Orderer program to run.

Because there is also a program configuration that runs the Orderer node later, the two are related, but they are two different configurations.

Let’s see what these configurations mean:

  • OrdererType: Version 2.0 and above is only one option, EtcDraft.

  • Addresses: Addresses the host address and port of the Orderer cluster for external access.

  • BatchSize: Conditions for generating a new block. If any of the following conditions are met, a new block will be created.

    • MaxMessageCount: The maximum number of transactions contained in a block.
    • AbsoluteMaxBytes: Indicates the maximum amount of transaction data in a block. If any single transaction exceeds this value, it will be rejected by orderer.
    • PreferredMaxBytes: When the volume of collected transaction data reaches this value, a new block is generated. If there is a single transaction data size larger than this value, a new block contains the transaction (only this transaction is in the block).
  • BatchTimeout: The maximum time to wait for a block to be generated. If the BatchSize condition is not met after this time, a new block will be generated.

  • Organizations: The organization that manages the Order cluster. Each organization has a unique MSP identity in the Fabric.

  • EtcdRaft: EtcdRaft configuration, including hosts, ports, and TLS certificate file paths for the Orderer cluster (used for inter-cluster access). Note that both server and client certificates need to be configured.

  • Capabilities: Omitted

  • Policies: a little.

Note

The above configuration that starts with Batch is Batch. Batch is a collection of transactions, not a block. The block contains a Batch and other metadata information, such as the block header. Therefore, the maximum block size is absolute Temaxbytes +metadata size.

Application configuration

Application configuration

This is the configuration of Channel at the application level. The current uses of this configuration are as follows: define Channel members; There are also default values for some configuration of the application channel when creating the application channel.

Take a look at it first:

  • ACL: The above has been explained, as for the specific meaning of each article, the use of related functions will be understood later.
  • Organizations: Organization member of a Channel.
    • Name: Each organization has a unique MSP name in the Fabric.
    • ID: Each organization has a unique MSP identity in the Fabric, usually the same as Name.
    • MSPDir: indicates the directory path of the organization MSP related files.

Consortiums configuration

Consortiums configuration

Organizations can combine with each other to form an alliance, which is defined here:

  • BondNetConsortium: Confederation name, which can be customized and does not need to be duplicated.
  • Organizations: A member of the alliance, as mentioned earlier, omitted.

When an application channel is created, the member that initializes the channel must be a member of a defined federation.

For example, in the Consortiums configuration, there is only one consortium, consisting of three organization members A,B, and C.

I’m now going to create A new application channel whose members can only be A subset of (A,B,C). It could be AB, ABC… It can’t be ABCD.

Formation block

The configuration file is finally done. The long configuration file is for this one command:



configtxgen -profile ForGenesisBlock -channelID system-channel -outputBlock ./system-genesis-block/genesis.block



By default, the program reads configtx.yaml from the current path as the configuration file.

If the configuration file is not in the current directory, the FABRIC_CFG_PATH environment variable can be used to specify the directory path.

# profile: Specifies which Profiles in the profile to use.

# channelID: Specify a Channel name, this time to create a system Channel.

# outputBlock: Specifies the path to the generated Genesis Block file.

Copy the code

After execution, the genesis. Block file is generated, which is the genesis block of the system channel.

I am a2Stream programmer, we next time again cheap!

This article is formatted using MDNICE