Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to benchmark a Fabric network with multiple sorting nodes using Hyperledger Caliper

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use Hyperledger Caliper to benchmark a Fabric network with multiple sorting nodes. I hope you will get something after reading this article. Let's discuss it together.

1. Basic configuration of Fabric network to be tested.

The test environment uses 3 virtual machines and is configured as follows:

Google cloud VM instance (n1-standard-4)

4 vCPUs, 15 GB memory

Ubuntu 18.04.2 LTS

Each virtual machine needs to install the following software in advance:

Docker version 18.09.8, build 0dd43dd87f or above

Docker-compose version 1.17.1 or above

Node.js v8.16.0

NPM 6.4.1

2. The topology of the Fabric network to be tested.

The Hyperledger Fabric network to be tested contains three participating institutions, a total of three sorting nodes use Raft consensus algorithm, each institution provides a sorting node and a peer node, and the peer node uses GoLevelDB as the state database.

3. Install Hyperledger Caliper

First, refer to the official documentation to install Hyperledger Caliper on HOST1.

Then run the benchmark in stand-alone mode to verify that Hyperledger Caliper is installed correctly.

Clone the Hyperledger Caliper software repository on all virtual machines participating in the Fabric network, or create a mirror of the HOST1.

On all virtual machines, clone the test network configuration file provided with this article to the following local directory:

~ / caliper/packages/caliper-samples/network/fabric-v1.4.1/swarm-3org1peer-raft

We are now ready for the Fabric network environment for Hyperledger Caliper benchmarking. The following figure shows the architecture of the sample benchmark in this article (Fabric version 1.4.1, 3org1peergoleveldb, Fabric-CCP adaptor):

Check the internal IP of the virtual machines to ensure that the virtual machines can communicate with each other. You may need to configure firewall rules to release some ports used by Caliper, such as 7050, 7051, 7051, 7054, 8051, 8054, etc.

4. Run the Caliper benchmark

We use Docker Swarm to manage containers.

4.1 create Docker Swarm

First create a Docker Swarm on the virtual machine where we ran the benchmark Caliper test. If all your hosts are on the same network segment, you can also use the host's internal IP.

$docker swarm init-listen-addr HOST1-REACHABLE-PUBLIC-IP:2377

Note: in the above command, you need to replace IP with your own IP.

After running the above command, you should see the following output:

# To add a worker to this swarm, run the following command:# docker swarm join-- token xxxxxxxxxxxxx IP:2377

This means that your Host1 has joined Swarm as a manager.

4.2 add other nodes to the Swarm cluster

Copy the following command to another host and execute:

Docker swarm join-token xxxxxxxxxxxxx IP:2377

After the above command is executed, the following will be entered to indicate that the host has joined the Swarm cluster:

# This node joined a swarm as a worker.

Run the above command on all machines that need to run the Caliper benchmark to join the Swarm cluster.

Note: on all hosts participating in the Hyperledger Caliper benchmark, the directory of the Caliper repository should be the same as on HOST1, because the system needs to locate the cryptographic material on this path. For example:

# home/HOST1/caliper/packages/caliper-samples/network/fabric-v1.4.1/swarm-3org1peer-raft/#home/HOST2/caliper/packages/caliper-samples/network/fabric-v1.4.1/swarm-3org1peer-raft/#home/HOST3/caliper/packages/caliper-samples/network/fabric-v1.4.1/swarm-3org1peer-raft/4.3 check Docker Swarm status

Run the following command on HOST1 to view the list of hosts in the Swarm cluster:

$docker node ls

The results are as follows:

ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS xxx * caliper-latest Ready Active Leader xxx caliper-latest2 Ready Activexxx caliper-latest3 Ready Active4.4 assigns the Fabric service container to the host

Open the docker-swarm-compose-tls.yaml file in the editor, where the Peer/Order/CA container is defined under Services. The details of container deployment can be found at the end of the Service definition:

Deploy: placement: constraints: [node.hostname = = YOUR-HOSTNAME]

Change the YOUR-HOSTNAME to the target host name that you want the service to deploy.

4.5. run the Hyperledger Caliper benchmark

Now run the following command under the Caliper directory of HOST1 to start the benchmark:

$caliper benchmark run-w. / packages/caliper-samples\-c benchmark/simple/config.yaml\-nAfter reading this article, I believe you have some understanding of "how to benchmark a Fabric network with multiple sorting nodes using Hyperledger Caliper". If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report