Skip to content

16ratneshkumar/Hyperledger_Fabric

Repository files navigation

Step 1: Create a new USER

  • It is always a smart idea not to use root to install these softwares. Let us create a new user.
sudo adduser <username>
  • Now we need to add our user to the sudo group.
sudo usermod -aG sudo <username>
  • Switch to our newly created user:
su <username>
  • Test the sudo access
sudo ls

Step 2: Install Prerequisites

Curl Installation

  • Run below command to install Curl.
sudo apt-get install curl
  • Verify the installation and check the version of Curl using below command.
curl --version

Git Installation

  • Open the ubuntu terminal and run below command. This will start the installation for Git.
sudo apt-get install git
  • Run below command to check if Git is successfully installed or not. This should return the version of Git.
git --version

Docker Installation

  • Install the latest version of Docker if it is not already installed.
sudo apt-get -y install docker-compose
  • Run below command to check if docker and Docker Compose is successfully installed or not. This should return the version of it.
docker --version
docker-compose --version
  • 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>

Go Installation

  • Run below command to install golang package.
curl -O https://dl.google.com/go/go1.18.3.linux-amd64.tar.gz
  • Extract the package.
tar xvf go1.18.3.linux-amd64.tar.gz
  • Set the GOPATH
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
  • Run below command to check if docker and Docker Compose is successfully installed or not. This should return the version of it.
go version

JQ (JSON query language Installation

Optional: Install the latest version of jq (only required for the tutorials related to channel configuration transactions).

sudo apt-get install jq

Step 3: Install Hyperledger Fabric Binaries, Docker Containers & Samples

  • Create new directory where you will install Hyperledger Fabric
mkdir fabric-network

Install Hyperledger Fabric

  • To get the install script:
curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh
  • To pull the Docker containers and clone the samples repo, run one of these commands for example
./install-fabric.sh docker samples binary

or

./install-fabric.sh d s b

Congrats, you have installed Hyperledger Fabric with all dependencies.

Step 4: Test the Installation

  • To test the our installation, we will run test network that comes with fabric-samples
cd fabric-samples/test-network
./network.sh down 
./network.sh up 
  • Using following Docker command we can check all running containers
docker ps -a

You should be able to see the containers up and running.

Step 5: Creating a Channel

  • You can use the network.sh script to create a channel between Org1 and Org2 and join their peers to the channel. Run the following command to create a channel with the default name of mychannel:
./network.sh createChannel
  • You can also use the channel flag to create a channel with custom name.Using following cmd:
./network.sh createChannel -c <channel_name>
  • If you want to bring up the network and create a channel in a single step, you can use the up and createChannel modes together:
./network.sh up createChannel

Thank you!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages