facebook

How to Set Up a Private Blockchain Network using Hyperledger Fabric

Calender

22nd March 2023

Clock

8 min read

Author
Vishal Prajapati

Associate Consultant - Development

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 building and deploying blockchain-based applications.

 

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.

 

Hyperledger Fabric, in contrast to most blockchains, is permissioned. It follows logically from this that the participants cannot be completely trusted because they are not anonymous. In essence, the network can be governed by a framework for handling disputes that are based on the confidence between participants.

 

Also, Check | Hyperledger Fabric for Aviation Parts Marketplace Development

 

In this developer's guide, we will explore how to set up a private blockchain network on Hyperledger Fabric. The test network will utilize two nodes to demonstrate the setup. 

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.

Table of Content

Author Vishal Prajapati

Vishal is a highly proficient Backend Developer with expertise in Mern Stack technology. He possesses a strong command over designing and developing smart contracts using Solidity and has successfully built REST APIs to facilitate communication between the blockchain and frontend systems. He effectively manages data using MongoDB and MySQL databases. He has a comprehensive skill set that includes JavaScript, Node.js, NestJS, MongoDB, MySQL, Docker, Solidity, and Microservices. Vishal has made significant contributions to various notable projects. Some of his noteworthy works include MisterZ, M2A, TRG Volume Bot, Arbitrage Bot, WethioNFT, Bitorio (Hedgex), Rafa, Apollo, and HODL Token. These projects highlight his ability to tackle diverse challenges and deliver innovative solutions in the field of backend development.

Associate Consultant - Development

bg bg

What's Trending in Tech

bg

Our Offices

India

INDIA

DG-18-009, Tower B,
Emaar Digital Greens, Sector 61,
Gurugram, Haryana
122011.
Unit- 117-120, First Floor,
Welldone Tech Park,
Sector 48, Sohna road,
Gurugram, Haryana
122018.
USA

USA

30N, Gloud St STR E, Sheridan, Wyoming (USA) - 82801
Singapore

SINGAPORE

10 Anson Road, #13-09, International Plaza Singapore 079903.

By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.