Hyperledger Caliper-Benchmark

Madhavi Kulkarni
3 min readFeb 17, 2020

--

Hyperledger Caliper is a blockchain benchmark tool, it allows users to measure the performance of a blockchain implementation with a set of predefined use cases. Hyperledger Caliper will produce reports containing a number of performance indicators to serve as a reference when using the following blockchain solutions: Hyperledger Besu, Hyperledger Burrow, Ethereum, Hyperledger Fabric, FISCO BCOS, Hyperledger Iroha and Hyperledger Sawtooth.

Caliper is published as the @hyperledger/caliper-cli NPM package and the hyperledger/caliper Docker image, both containing the CLI binary.

Setting up Caliper-benchmark has three steps:

  1. Clone the repository
  2. Install Caliper Cli
  3. Bind the Cli to SDK
  4. Invoke the local Cli
  5. Run Report.html

Pre-Requisites:

  1. Clone the caliper benchmark source code from Benchmark repository:

Now go to the folder

cd caliper-benchmark

Unless you are embedding the Caliper packages in your own application, you will probably use Caliper through its command line interface (CLI).

user@ubuntu:~/caliper-benchmarks$ npm i @hyperledger/caliper-cli

The entry point of the CLI is the caliper binary. You can confirm whether the CLI is installed correctly by checking its version:

user@ubuntu:~/caliper-benchmarks$ npx caliper --version
v0.2.0

Now check if you have package.json file. If not, run below command

user@ubuntu:~/caliper-benchmarks$ npm init -y

2. Install Caliper CLI:

user@ubuntu:~/caliper-benchmarks$ npm install --only=prod @hyperledger/caliper-cli

3. Bind the CLI to the SDK:

user@ubuntu:~/caliper-benchmarks$ npx caliper bind --caliper-bind-sut fabric --caliper-bind-sdk 1.4.0

4. Invoke the local CLI:

user@ubuntu:~/caliper-benchmarks$ npx caliper benchmark run --caliper-workspace . --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-networkconfig networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml

Once you run the above command, Invoking starts:

Here chaincodes are installed on the channel and instantiated. After successful instantiation, The test results are visible as

Test results for opening accounts
Test Results for Query accounts
Test results for transferring

At the end you will see that the Benchmark run successful.

Benchmark run successful.

Once the benchmark runs successfully, You can find a file report.html

5. Open the file(report.html) in browser to see the report

For Open
Query
Transfer

Hope the post is helpful . In case if you are facing any difficulty, let me know in the comment section, I will try my best to solve it.

Happy learning :)

--

--

Madhavi Kulkarni
Madhavi Kulkarni

Responses (6)