How to Set Up a Private Blockchain Network using Hyperledger Fabric

How to Set Up a Private Blockchain Network using Hyperledger Fabric
3 min read

Hyperledger Fabric is an open-source blockchain framework that provides a modular architecture for developing enterprise-grade distributed ledger applications. It was created by the Linux Foundation’s Hyperledger project and is designed to address the needs of businesses that require a flexible, scalable, and secure platform for Hyperledger application development.

Using a plug-and-play design, Hyperledger Fabric is a platform for building enterprise-grade blockchain networks. Hyperledger Fabric uses Distributed Ledger Technology (DLT) to build a permissioned blockchain system. Unlike other platforms that require non-standard or domain-specific languages, it is the first platform where smart contracts can be created in general-purpose programming languages like Java, Go, and Node.js.

Permissioned blockchains, like Hyperledger Fabric, differ from most others. It follows logically from this that it is impossible to fully trust the participants because they are not anonymous. Fundamentally, a framework for resolving conflicts based on member confidence can control the network.

Also, Check | Hyperledger Fabric for Aviation Parts Marketplace Development

We will look at how to build up a Hyperledger Fabric private blockchain network in this developer's tutorial. To illustrate the configuration, the test network will make use of two nodes.

Setting up a Private Test Network

To run a Docker-based fabric test network these are the prerequisites:

1. Install the latest version of git if it is not already installed.

$ sudo apt-get install git

2. Install the latest version of cURL if it is not already installed.

$ sudo apt-get install curl

3. Install the latest version of Docker if it is not already installed.

$ sudo apt-get install -y install docker-compose

Install Fabric and Fabric Samples

$ curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh

$ ./install-fabric.sh docker samples binary

Run the Fabric Test Network

1. Clone Fabric Samples git repo

$ git clone https://github.com/hyperledger/fabric-samples.git

2. Go to fabric-samples/test-network

$ cd fabric-samples/test-network

3. Start the test network

$ ./network.sh up

It will produce the following output

Creating network “fabric_test” with the default driver
Creating volume “net_orderer.example.com” with default driver
Creating volume “net_peer0.org1.example.com” with default driver
Creating volume “net_peer0.org2.example.com” with default driver
Creating peer0.org2.example.com … done
Creating orderer.example.com … done
Creating peer0.org1.example.com … done
Creating cli … done
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1667543b5634 hyperledger/fabric-tools:latest “/bin/bash” 1 second ago Up Less than a second cli
b6b117c81c7f hyperledger/fabric-peer:latest “peer node start” 2 seconds ago Up 1 second 0.0.0.0:7051->7051/tcp peer0.org1.example.com
703ead770e05 hyperledger/fabric-orderer:latest “orderer” 2 seconds ago Up Less than a second 0.0.0.0:7050->7050/tcp, 0.0.0.0:7053->7053/tcp orderer.example.com
718d43f5f312 hyperledger/fabric-peer:latest “peer node start” 2 seconds ago Up 1 second 7051/tcp, 0.0.0.0:9051->9051/tcp peer0.org2.example.com

The Components of the Test Network

$ docker ps -a

We are a group of qualified  Hyperledger developers who use frameworks hosted by Hyperledger to create quick and safe blockchain applications. Once you inform us of your needs, a technical expert will organize a call and thoroughly explore your concept.

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Oodles Blockchain 58
Full-Stack Blockchain Development Services and Solutions for Startups and Enterprises for Business Excellence Transform your business processes into highly sec...
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up