Run a java program to load test a blockchain network.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7ae2bd4 Oct 16, 2018
Permalink
Failed to load latest commit information.
images Add files via upload Oct 16, 2018
src Initial commit Mar 27, 2018
.gitignore Initial commit Mar 27, 2018
LICENSE Initial commit Mar 27, 2018
README.md Update readme link Mar 30, 2018
pom.xml Initial commit Mar 27, 2018

README.md

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

Apache 2.0