Caliper Multihost Benchmark Setup For Hyperledger Fabric


Table of Contents

Read Time: 4 minutes


This tutorial is indent to help you setup fabric in multiple machine and taking benchmark using caliper.

Blockchain has emerged as a public ledger that records all transactions in the network and it is distributed among all the participants. It is decentralised hence no one controls the blockchain,but every individual user can inspect transactions at any time.

Later blockchain enters in the enterprise domain, where it is decentralised and at the same time the administrator of the organization can determine the roles and permissions of each node.

Hyperledger fabric is a private blockchain framework developed by IBM and it is the first project hosted by Linux foundation.

Hyperledger caliper is a blockchain benchmark tool,its is also hosted by linux foundation.Caliper is used to measure the performance of a specific blockchain implementation such as TPS(Transaction Per Second),transaction latency,resource utilisation


  • You should be familiar with basic hyperledger fabric.
  • Make sure your machine has the following
  • Docker version 18.09.8,
  • docker-compose version 1.17.1
  • Node.js v8.16.0
  • NPM 6.4.1

Caliper Installation

After installing the  prerequisites, clone the caliper repository from github.

Run the command below to clone latest caliper repository.

Git clone

Once the cloning is finished go to the caliper folder and install the required packages.

To install required packages go to caliper root directory follow the steps below.

npm install

npm run bootstrap

cd packages/caliper-tests-integration

npm run start_verdaccio

npm run publish_packages

npm run install_cli

Go to caliper-samples folder which is inside the caliper folder and run the command to ensure that caliper installation is successful.

caliper benchmark run --caliper-workspace ./ --caliper-benchconfig benchmark/simple/config.yaml --caliper-networkconfig network/fabric-v1.4.1/2org1peercouchdb/fabric-node.yaml

The above command will generate benchmark report in html format and stores it in the working directory.

We can setup fabric network easily by using the samples provided in the caliper-samples folder.

For this tutorial we will be using 2org1peercouchdb  of fabric 1.4.1.

As the name suggest we will be having the code to set up fabric network with two organisations each having one peer.You can also experiment with other samples with tls enabled or disabled as you prefer.For this tutorial the minimal approach is taken for basic understanding.

Caliper requires a benchmark configuration file and fabric network configuration file.The benchmark configuration file defines the arguments such as workload and monitoring settings. The network configuration file or the blockchain configuration file specifies the information required to interact with the backend blockchain network.

For this tutorial we will be using simple benchmark config which is provided in the samples.We need to modify the fabric network configuration file to specify ip address of the other physical machine.If you want to create more number of organisations and peers you must edit crypto-config.yaml and configtx.yaml with with required changes and generate artifacts.

Initially we will edit fabric-node.yaml in the first machine.This is our network configuration file that caliper requires.In the caliper samples under the network directory open  fabric1.4.1 and edit fabric-node.yaml.After editing the file should be like the following.

1st machine fabric-node.yaml

<script src=""></script>

As mentioned earlier our first machine consists of an organization with one peer,an orderer and a certificate authority.According to this we modify docker-compose.yaml 

1st machine docker-compose.yaml <script src=""></script>

In the second machine we need to setup a fabric network having one organization with a single peer. We can use the samples provided in the caliper-samples directory.To do that we have to install caliper on second machine.Follow the caliper installation steps given above to install the caliper on the second machine

On the second machine we have another organisation having single peer.Here we only need to edit the docker-compose.yaml. We need to add peer from first organisation as an extra hosts so that the two peers can establish a channel and communicate.

After editing the file should be as below :


<script src=""></script>

Run the below command to start the peer.

Docker-compose up -d

We have to run caliper in first machine.The second machine will join the network.

After completing all the above steps,In first machine enter the command below to get benchmark readings.We assume that you are in caliper-sample directory.if not then please make sure the path for the files in the command are entered correctly.

caliper benchmark run

 --caliper-workspace ./ --caliper-benchconfig benchmark/simple/config.yaml --caliper-networkconfig network/fabric-v1.4.1/2org1peergoleveldb/fabric-node.yaml

 Automated Caliper multi-host network setup using the script:


  • Docker version 18.09.8,
  • docker-compose version 1.17.1
  • Node.js v8.16.0
  • NPM 6.4.1
  • Before running the scripts make sure you have installed the prerequisites with latest version except node,we recommend using node 8.
  • These steps are automated using shell script , there are two scripts,one for setting up the first machine and one for setting up the second machine.

In your first machine create a new file or any name you like ending with an extension .sh and copy the code below 

<script src=""></script>

If your newly created script is not executable use the command below to make it executable and run it.

Sudo chmod 777

In the second machine create a file and copy the code below

<script src=""></script>

Run the below commands to make it executable and to run.

Sudo chmod 777


To run caliper go to the caliper-samples directory and enter the code below

caliper benchmark run --caliper-workspace ./ --caliper-benchconfig benchmark/simple/config.yaml --caliper-networkconfig network/fabric-v1.4.1/2org1peergoleveldb/fabric-node.yaml

At QuillHash, we understand the Potential of Blockchain and have a good team of developers who can develop any blockchain applications like Smart Contracts, dApps,Smart Coins, DeFi, DEX on the any Blockchain Platform like EthereumEOS and Hyperledger.

To be up to date with our work, Join Our Community :-

Telegram | Twitter | Facebook | LinkedIn


Related Articles

View All


We have audited 100+ web3 projects.

Here are 5 steps to perform a smart contract audit 👇👇

Thread 🧵

The $2M @mirror_protocol exploit post #TerraLUNA crisis was due to one of the the trivial vulnerabilities.

The pricing oracle set the proce fo #Luna to that of the new version of the coin even as the price of the original coin plummeted far below 1 cent.


A lot of founders think third-party audits are a waste of time and money.

They’re wrong!

They help you

- Reduce time-to-market
- Focus on launch prep
- Product development
- Build community trust


Load More...

Inverse Finance hacked again for $1.2M⚠️In ‘Optimism’ Tokens 🚨

Inverse Finance’s Frontier money market was subject to an oracle price manipulation incident.It resulted in a net loss of $5.83 million in $DOLA, with the attacker earning a total of $1.2 million. 

Become a Quiffiliate!
Join our mission to safeguard web3

Sounds Interesting, Right? All you have to do is:


Refer QuillAudits to Web3 projects for audits.


Earn rewards as we conclude the audits.


Thereby help us Secure web3 ecosystem.

Total Rewards Shared Out: $150K+