Hyperledger Fabric is one of the leading enterprise grade blockchain platforms. In this article we will cover Prerequisites and Hyperledger Fabric v2.4 installation on Linux Ubuntu 20.04 LTS.
sudo apt update
sudo apt-get install git
sudo apt-get install curl
Install the latest version of Docker if it is not already installed.
sudo apt-get -y install docker-compose
Once installed, confirm that the latest versions of both Docker and Docker Compose executables were installed.
Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1
docker-compose version 1.25.0, build
Make sure the Docker daemon is running.
sudo systemctl start docker
Optional: If you want the Docker daemon to start when the system starts, use the following:
sudo systemctl enable docker
Add your user to the Docker group.
sudo usermod -a -G docker <username>
curl -O https://dl.google.com/go/go1.18.3.linux-amd64.tar.gz
tar xvf go1.18.3.linux-amd64.tar.gz
Now, you have to open and edit you **bashrc **file. In most cases, the bashrc is a hidden file that lives in your home directory.
Add following two lines, at the end of the file:
Create new directory where you will install Hyperledger Fabric
To download a specific release, pass a version identifier for Fabric and Fabric CA Docker images. The command below demonstrates how to download the latest production releases - Fabric v2.4.4 and Fabric CA v1.5.3
curl -sSL https://bit.ly/2ysbOFE | bash -s -- <fabric_version> <fabric-ca_version>
curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.4.4 1.5.3
Download the latest release of Fabric samples, docker images, and binaries.
curl -sSL https://bit.ly/2ysbOFE | bash -s
Congrats, you have installed Hyperledger Fabric with all dependencies.
To test the our installation, we will run test network that comes with fabric-samples
./network.sh up createChannel -ca -c mychannel -s couchdb
The above command will create a channel(mychannel) with certificate Authorities and bring up couch-db as state database.
Using following Docker command we can check all running containers
docker ps -a
You should be able to see the containers up and running.
Congratulations, you have installed and setup Hyperledger Fabric.
If this tutorial helps you, please hit the Clap button or comment if you have any suggestion or feedback.