Many distributed blockchains, such as Ethereum and Bitcoin, are not permissioned, which means that any node can participate in the consensus process, wherein transactions are ordered and bundled into blocks. Because of this fact, these systems rely on probabilistic consensus algorithms which eventually guarantee ledger consistency to a high degree of probability, but which are still vulnerable to divergent ledgers (also known as a ledger “fork”), where different participants in the network have a different view of the accepted order of transactions.
Hyperledger Fabric works differently. It features a node called an orderer (it’s also known as an “ordering node”) that does this transaction ordering, which along with other orderer nodes forms an ordering service. Because Hyperledger Fabric’s design relies on deterministic consensus algorithms, any block validated by the peer is guaranteed to be final and correct. Ledgers cannot fork the way they do in many other distributed and permissionless blockchain networks. See more about ordering services in the Hyperledger Fabric documentation provided here.
Catalyst Blockchain Platform's ordering service is also a template for ordering nodes as a peer set for peers.
Every network begins with an ordering system channel. If you need to add an organization to the application channel, you need to add it as the system channel member. The policies in the ordering system channel configuration blocks govern the consensus used by the ordering service and define how new blocks are created.
The system channel also contains information about the organizations that are the members of the ordering service (orderer organizations) and those allowed to create new channels (consortium organizations).
Note: In the current version of Catalyst Blockchain Platform, each organization needs to contribute an ordering node to the ordering service to become a part of a network. Therefore, each organization in Catalyst Blockchain Platform is an orderer organization. However, not every orderer organization is a member of the consortium.
Note: Starting from V.2.3, Hyperledger Fabric provides an orderer channel management without a system channel. However, this is not supported by the current version of Catalyst Blockchain Platform.
Starting from version 2.0, the Hyperledger Fabric blockchain only supports Raft consensus, therefore, the Catalyst Blockchain Platform also only supports the Raft protocol. Raft is a crash fault-tolerant consensus protocol that allows multiple non-trusting organizations to reach a mutual agreement through a leader-follower concept.
The minimum number of orderers (or consenters in the Raft terms) required to ensure that the consensus is effective is called a quorum. For every consenter set, this is a majority of nodes. For instance, an ordering service with 5 nodes requires 3 nodes to make a quorum, 2 node service requires 2 nodes available, and so on. To read more about Raft concepts, click here.
Note: Add and remove consenters carefully. If the nodes' quorum is not available, the ordering service will not work, which eventually means that no new transactions will appear on the channel. If the nodes' quorum at the system channel is not available, the whole network will be unavailable, no network configurations can be made, and no consenters can be added until a quorum is reached.
You are required to create an ordering service for your organization under two circumstances:
- If you have created a new organization on the network and add an ordering service for the first time.
- If you delete an existing ordering service.
In either case, you have to follow the steps mentioned below to create an ordering service:
Add ordering service
- 1.Click on the “Add ordering service” button.
- 2.It will open a menu on the right side of the screen, as shown in the figure above, where you have to provide the following information:
- Ordering service name
Using a predefined image is recommended for compatibility issues. However, you can select your image if needed.
If you want to use an image from a private repository you should specify an imagePullSecret (a server name, your login, and your password). You need to specify a secret only once and then select the secret from a drop-down list.
You can create an imagePullSecret in your Kubernetes cluster and add the label
"app.kubernetes.io/name": "image-pull-secret". After that, the secret will be available in the drop-down list.
Note that after removing your secret from the list Catalyst Blockchain Platform won't be able to use an image with this secret. In this case, you need to change the image/repository or create a new secret naming it the same.
- Requested CPU - Guaranteed CPU resource that will be allocated to the ordering node.
- CPU limit - Maximum CPU resource that can be allocated to the ordering node.
- Requested memory (MB) - Guaranteed amount of RAM that will be allocated to the peer node.
- Memory limit (MB) - Maximum amount of RAM that can be allocated to the peer node.
- Storage size.
- Add variables.
Note: Please do not customize the following list of environment variables to ensure that your Hyperledger Fabric Blockchain runs seamlessly:
3. You can click on the preview button to confirm all of the configurations. You can either go back to change any configuration or, if everything is correct, you can click on the submit button, which adds the ordering service to your organization.
After adding an ordering service, you can add ordering nodes, also known as consenters. The process of adding an ordering node is explained in the subsequent section.
Note: Each organization can have only one ordering service, but we plan to support multiple networks in future releases.
To create a new ordering node, you can click on the “Add new node” button in the inner screen's upper right-hand corner.
Create an orderer
When this button is clicked, a new side window appears, which displays the first of three steps required to add a new orderer.
- 1.Provide the following details and click the “Next” button: Orderer name - Can not be the same as any other orderer in the organization. Select MSP - The selected MSP is responsible for providing identity to the orderer on the network.
- 2.Select CA from the dropdown menu. There are two options for defining the identity of the ordering node. You can choose the “Select identity” option and choose a predefined identity from the dropdown menu. You can choose the “New identity” option and define the new identity for the ordering node along with a new password.
- 3.While the third step is quite similar to the second step, the fundamental difference between them is that step two is for enrolling identity, and step three is for enrolling a TLS certificate.
You can create a new ordering node (orderer) either through the “Add new node” button on the upper right-hand corner of the ordering service page or when you open the ordering service page (by clicking on the name of the ordering service) and then selecting “Add node.” In either case, you will have to follow the same steps as mentioned in the section above.
After you successfully add a new ordering node, you can see it under the “Orderers” tab. Any new ordering nodes created have the pending status along with the “No Genesis Block” button. The “pending” status gets changed to “running” within a few minutes. However, the ordering node will not function in the network before the addition of the genesis block. You need to add the genesis block for the new ordering node to be in sync with the network configuration.
No genesis block label
You can click on the “No Genesis Block” button, which opens a side window.
If you are bootstrapping the network, you will need to generate a genesis block.
Generate genesis block
- 1.Select the ordering node for which you want to generate the genesis block (at least one) and click on the “Next” button.
- 2.Provide the consortium name, consortium organizations, orderer organizations. You can also add other organizations as Orderer Organization and to the Consortium by adding their MSP and consenter JSON profile, or you can skip it for the time being and add later as described here.
Tip: Orderer’s JSON profile should be exported (see screenshot) by the organization you want to add as a member and sent to you via an external messaging channel.
Export an orderer's JSON profile
3. Define the system channel configurations: and the batch timeout and batch size. Please refer to this section of the Hyperledger Fabric documentation to learn more about these parameters. All fields are pre-populated with the recommended settings that can be modified.
4. Provide the Raft options such as the tick interval or max inflight blocks. To know more about these configurations, please refer to this section.
If you are joining an existing network, you are required to fetch the genesis block for which you would need to provide the external link from any existing consenter that joined the system channel.
Fetch genesis block
To be able to fetch the genesis block:
- Any network member should copy the orderer's external link and send it to you via external channels such as email or messenger.
Copy an orderer's external link
If you are already a network member and you are adding another orderer to the system channel:
- 1.Add a new orderer to the consenter set on the system channel at the Raft page manually (see screenshot below).
- 2.Fetch a genesis block by providing an external link to one of your consenters, which is already a part of the system channel.
Note: Please ensure that you’ve added your new consenter to the consenter set (step 1) before fetching the genesis block. If you do not add a new orderer to the consenter set, you will be able to fetch the genesis block by this orderer and even add it to the application channel, but it will not be working properly.
Add an orderer to the consenter set on the system channel
Once the ordering node is added to the system channel and successfully fetches a genesis block, you can add it to the application channel as a consenter.
The Orderers page gives information about the organization's ordering service along with the ordering nodes or consenters. There is one main page and two inner pages.
On the main page, you can see the name of the ordering service and view all of the existing orderer nodes of an organization.
Every ordering node is represented in a box that contains the following details.
- The name of the ordering node.
- Organization MSP name.
- A scrollable inner box displaying the ordering node labels.
- A certificate symbol to see certificates details.
- The link button to view the external ordering node link.
- Export button to export the JSON file containing information regarding the node.
- The status symbol on the top right corner representing the state.
The ordering node can exist in any of the following five states at any point in time:
- Pending - A node is in the process of starting, or is awaiting the expansion of the Kubernetes cluster. Usually, when there are insufficient nodes to support the Hyperledger Fabric Blockchain Network, the Kubernetes cluster needs to expand, and the peers have to wait in the process.
- Running - A node is successfully created and is ready to be used on the network.
- Terminating - When the user initiates the process of removal of a node.
- Failed - In case a node is unable to start due to some reason. It usually happens when the existing allocated resources have been exhausted, such as memory or storage.
- Unknown - For some reason, a node’s status was not obtained.
When you click on the ordering node, the screen is updated to show only that particular node with its relevant information.
Ordering node details
A new section labeled “Orderer actions” also becomes visible on the Orderer node page. Under this section, you can perform the following actions on the orderer node:
- Restart - Restarts the corresponding node. This action is recommended if there is any issue with the ordering node or configurations are updated.
- Delete - Deletes the orderer node from the ordering service.
Note: If you are deleting an ordering node, you have to remove it manually from application channels and then from the Raft page too so that it is no longer a part of the system channel. If this step is not completed, the ordering node will exist in channels, affecting the quantity of the orderers for the quorum.
Please do not delete the last orderer node as it will disable your communication with the network.
Under the Orderers tab, you can see the name of the ordering service for your organization. By clicking on this name, the interface will take you to the Ordering service page. The page contains two sections.
In the upper section, two actions are available:
- Delete ordering service - In case you want to delete your ordering service, we recommend the following flow:
- 1.Remove your orderer nodes from the application channels.
- 2.Remove your orderer nodes from the system channel.
- 3.Delete your ordering service.
Note: After the ordering service deletion another network member should remove your deleted consenters from the application and system channels manually if you did not remove it by yourself before. Elsewhere these consenters can affect the quantity of the quorum.
The lower section is divided into the following three parts represented by three tabs.
You can view the ordering service information under this section along with a list of environment variables.
Environment variables tab
This is the list of the organizations that can create a channel. Under this tab, you can add or remove organizations from the consortium. Any non-consortium members can not create a channel and can not be added to a channel at channel creation. However, the non-consortium members can be added to the channel later by the consortium members.
Note: Only consortium members can add or remove other organizations from the consortium.
Consortium members tab
There are two sections available under this tab.
Orderer organizations - List of organizations that are added to the system channel as a member of the ordering service (in Catalyst Blockchain Platform, each organization that is a network member is an orderer organization, so it is also a list of network members). They can add orderers (consenters) to the channels. You can add organizations as Orderer organizations through the “Add” button or remove organizations by clicking the “Remove” button.
Note: The Remove organization action removes the organization along with its consenter. Because of Raft specifics, you cannot remove an organization with more than one consenter belonging to this organization. To remove the organization with two or more consenters, please remove its consenters from the channel.
Consenters - List of orderers that are added to the system channel. Only these orderers can be added as a consenter to the application channels. Under this section, you can add or remove consenters. You can also see the certificates of a particular consenter.
You can add an organization to the list of orderer organizations in one of two ways.
Add an organization to the network while generating a genesis block
You need to select the organization from the drop-down menu and provide its orderer JSON profile upload (this JSON profile needs to be exported and shared with you by the organization you will add). Only one orderer can be added for each organization that can be only one at a time.
Note: The organization to be added must be present in the partners’ MSP list. If it is not present in the partners’ MSP list, it will not appear in the drop-down menu. To add an organization to your partners’ MSP list, please visit this section.
Important. If you are adding organizations during this step, please ensure that you’ve added more orderers that belong to your organization than the number of organizations you are going to add. Otherwise, a quorum will not be achieved, and new ordering nodes will not fetch a genesis block to start functioning.
2. On the Raft page on the Ordering service details tab.
Add an organization to the network
Click the “Add organization” button. The process is the same as described in the previous section.
You can add an organization to the consortium in one of two ways.
1. While generating a genesis block when bootstrapping the system channel.Add an organization to the consortium while generating a genesis block
Add another organization while generating a genesis block
You need to select the organization from the drop-down menu.
You should also add an organization to the list of ordering organizations (see the screenshot above).
Note. The organization to be added must be present in the partners’ MSP list. If it is not present in the partners’ MSP list, it will not appear in the drop-down menu. To add an organization to your partners’ MSP list, please visit this section.
2. On the Consortium page on the ordering service details tab.
Click the “Add an Organization” button and select an organization from the drop-down menu.
Note: The organization to be added to the consortium must be present in the orderer organization list.
Note: Only consortium members can add other organizations to the consortium.
Add an organization to the consortium.