Configurations in Hyperledger Fabric — Decoding configtx.yaml

Akash Gupta
Theta One Software
Published in
3 min readApr 7, 2021

In Hyperledger Fabric to create a network according to an organisation’s structure and to bootstrap a channel, we need to have following artifacts.

  1. A genesis block
  2. Channel configuration info

All these channel properties are configured using a file, configtx.yaml. It consists of following :

  • organizations section
  • orderers section
  • applications section
  • capabilities section
  • profiles section

Organizations Section in configtx.yaml file

This section contains the organization details and that organization can be orderer or peer one.

In below structure, very first tag is “Organizations:” and under that we can define any number of organizations as per the requirement.

Each organization has name, ID and MSPDir. Here MSPDir is location where cryptography material for that organization is stored.

It also has host and port details for it’s anchor peer as well.

Then comes one of the most important concept of Hyperledger Fabric — Policies. Here we can define access policy for various users/peers in the Org network. For more on policies refer to

Orderer Section in configtx.yaml file

This section contains the details about orderer. This helps to create genesis block as well.

OrderType: This can have value as “solo” or “kafka” or “raft”. solo is used during development and kafka/raft is used in production environment.

Addresses: This contains host and port details of orderer.

BatchTimeout: The role of the orderer is to create batch of transactions. So the value of this key will specify the time for which the orderer will wait to create the batch.

Max Message Count: The maximum number of messages permitted in a batch.

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

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.

For more on policies refer to

Application section in configtx.yaml file

Application is being referred in the genesis block. As shown this section contains application level grant of policy i.e it specifies who can make various levels of ammendments to application configuration.

Capabilities section in configtx.yaml file

The idea behind this is to avoid any impact to the network when there are different version of Fabric code running on nodes and everyone has same view of transaction.

Capabilities of different types as mentioned below.

Channel: This capability applies to both peer and orderers and are located in the root Channel group.

Orderer: Applies to orderers only and are located in the Orderer group.

Application: Applies to peers only and are located in the Application group.

Profile section in configtx.yaml file

Last and important section in configtx.yaml file is profile section. It consist of mainly two parts, one is genesis block details and second is channel details. Let’s understand it with example.

AirlineOrdererGenesis refers to genesis block and has required details under that. It contains capabilities of block, orderer details ( organization and capabilities), consortium details ( peer organizations).

AirlineChannel refers to channel that helps to create required channel.

--

--