Hyperledger Fabric Network Upgrade in one click.

Padmaraj Kore
Coinmonks
Published in
3 min readSep 5, 2023

--

In the fast-evolving landscape of blockchain technologies, staying up-to-date with the latest versions of platforms like Hyperledger Fabric is crucial. This article introduces a powerful tool that simplifies the process of upgrading orderers and peers within your Hyperledger Fabric network. Whether you’re a seasoned developer or a novice in the blockchain world, this script will help you seamlessly transition to newer versions of Hyperledger Fabric, ensuring the uninterrupted operation of your blockchain network.

Co-author : Akkahshh Agarwaal

Before we dive into the details, please note that this script is intended solely for upgrading purposes. We do not recommend using it to downgrade to versions lower than 2.5.x. The only supported downgrades are from version 2.5.x to 2.5.y, where y is less than x.

Prerequisites

Before you get started with this upgrade script, make sure you have the following prerequisites in place:

  • A running Hyperledger Fabric network.
  • Access to the Docker command-line interface (CLI).
  • Proper permissions to stop and start Docker containers.

Now that we have the prerequisites sorted, let’s explore how to use this script effectively.

Usage

To upgrade an orderer or peer within your Hyperledger Fabric network, follow these simple steps:

  1. Begin by cloning or downloading this script repository to your local machine. You can find the repository here.
  2. Navigate to the directory where you’ve stored the repository.
  3. Execute the upgrade_entity.sh script with the following parameters:
  • -e: Specify the name of the entity (e.g., orderer.example.com, peer0.org1.example.com).
  • -t: Indicate the type of entity (orderer or peer).
  • -v: Specify the target version to upgrade to.

For instance, to upgrade an orderer to version 2.5.1, you would use the following command:

./upgrade_entity.sh -e orderer.example.com -t orderer -v 2.5.1

And to upgrade a peer to version 2.5.1, the command would be:

./upgrade_entity.sh -e peer0.org1.example.com -t peer -v 2.5.1

Here are some demo commands for reference:

  • Upgrade a peer:
./upgrade_entity.sh -e peer0.org1.example.com -t peer -v 2.5.1
  • Upgrade another peer:
./upgrade_entity.sh -e peer0.org2.example.com -t peer -v 2.5.1
  • Upgrade an orderer:
./upgrade_entity.sh -e orderer.example.com -t orderer -v 2.5.1

Important Notes

  • While this script simplifies the upgrade process, please exercise caution when using it in a production environment. It’s strongly recommended to test the upgrade process in a development or staging environment first.
  • Always maintain up-to-date backups of your network data. This precautionary step helps mitigate any potential issues that may arise during the upgrade process.
  • Ensure that you have the necessary permissions and access rights to perform these actions on your Hyperledger Fabric network.

Quick Execution

For those who prefer convenience and no need of downloading the repo, you can directly execute this script using terminal commands. Here are some examples:

  • Upgrade an orderer to version 2.5.1:
curl -sSL https://bit.ly/461nYAv | bash -s -- -e orderer.example.com -t orderer -v 2.5.1
  • Upgrade a peer to version 2.5.1:
curl -sSL https://bit.ly/461nYAv | bash -s -- -e peer0.org1.example.com -t peer -v 2.5.1
  • Upgrade another peer to version 2.5.1:
curl -sSL https://bit.ly/461nYAv | bash -s -- -e peer0.org2.example.com -t peer -v 2.5.1

Further Resources

For more information about Hyperledger Fabric and its upgrades, please visit the official documentation.

If you want to explore a step-by-step guide on upgrading nodes in a Hyperledger Fabric network, you can also check out the article titled “Upgrading Nodes in a Hyperledger Fabric Network: A Step-by-Step Guide”.

If you require support or have any inquiries, feel free to open an issue on this repository here. Your feedback and questions are essential for the improvement of this upgrade script. Happy upgrading!

--

--