Skip to content

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.

License

Notifications You must be signed in to change notification settings

ghas-results/loadtesting-the-Blockchain-Network

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING: This repository is no longer maintained ⚠️

This repository will not be updated. The repository will be kept available in read-only mode.

Load testing the Blockchain Network

This pattern is continuation of the Leveraging cache and MessagingQueue to scale Blockchain Network . In this pattern, we are going run java programs to load test our blockchain network i.e. to send request to blockchain network and to check for results of request execution. MongoDb is used to keep track of statistics for the load testing.

Included Components

  • Hyperledger Fabric
  • Docker
  • Hyperledger Fabric SDK for node.js
  • Mongodb
  • Java

Application Workflow Diagram

Application Workflow

  • Run the ExecutionApp and ResultGenerator java program in separate terminals
  • View the execution results in mongodb

Prerequisites

  • Maven

Steps

docker run -p 27017:27017 -d mongo
  • Issue a git clone https://github.com/IBM/loadtesting-the-Blockchain-Network.git
  • Verify the executionURL, resultURL urls from ExecutionApp.java and ResultGenerator.java.
  • Make sure your are connecting to correct mongodb instance and dbName are same in ExecutionApp.java and ResultGenerator.java.
  • Open terminal and run the following commands to setup the project
mvn compile
  • Now run the test result loader Application
mvn exec:java -Dexec.mainClass="secretApp.testApp.ResultGenerator"
  • In a new terminal,run the execution cli app
mvn exec:java -Dexec.mainClass="secretApp.testApp.ExecutionApp"
  • If required, you can scale the number of task execution containers by navigating back to the network directory and running the following command:
docker-compose -p "fitcoin" up -d --scale fitcoin-backend=<No of containers>

For eg:

docker-compose -p "fitcoin" up -d --scale fitcoin-backend=3

Note: To view the results you can download robomongo/ Robo 3T. Currently, ExecutionApp is configured to send enroll request for user types, query request for user state and invoke request for generating fitcoins which can be modified according to the requirements.

Additional Resources

License

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.

Apache Software License (ASL) FAQ

About

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%