JABS - Just Another Blockchain Simulator.
JABS is a blockchain network simulator aimed at researching consensus algorithms for performance and security. It is designed to easily handel simulation of networks as large as normal public blockchain networks (~10000 nodes) in reasonable time.
There are two suggested installation methods Introduced here. Installation on a Debian-based linux like Ubuntu and installation using Dockerfile.
First, you should install git
, openjdk-17-jdk
, and maven
.
$ sudo apt install git openjdk-17-jdk
$ sudo apt install maven
After that, clone the git repository.
$ git clone https://github.com/hyajam/jabs.git
Use maven mvn
to make a jar file.
$ cd jabs
$ mvn clean install
You might need to set JAVA_HOME
to java home directory (this
might vary depending on your linux distribution and jdk version):
$ JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/; mvn clean install
Then to run the compiled jar file.
$ java -jar target/jabs.jar
The easiest method for running jabs is using docker-compose
. You need
to have git
and docker-compose
installed on your system. Clone
the repository using git.
$ git clone https://github.com/hyajam/jabs.git
Then, use docker compose to build an image and run the container. The output
of simulation will be automatically sent to output/
folder.
$ cd jabs
$ docker-compose up
If your user id and group id are not 1000 you might need to change the
values in Dockerfile
and compose.yaml
accordingly. You might be able to
find your user id and group id using commands id -u
and id -g
in linux.
Currently, you can use JABS by editing Main.java file and creating new scenarios for your tests.
Currently, the following consensus algorithms are implemented in JABS:
- Nakamoto Consensus
- Ghost protocol
- PBFT
- Casper FFG
- IOTA Tangle
- Nakamoto Heaviest-Chain
- Robust Round Robin
- Add new block mining process that can support adjustable difficulty.
- Add multiple loggers and scenarios in main class.
- Add detailed comparison with other simulators in README.md.
- Add new network latency stats that has countries instead of continents.
- Add events for network churn.
- Exploring possible multithreading options.
- Add new consensus algorithms:
- IOTA
- Honey Badger BFT
- DPoS
- Bitcoin Simulator: developed in C++ and based on NS3. Can simulate Bitcoin, Litecoin, Dogecoin and probably other blockchain networks based on Nakamoto Consensus. Although it is probably the most accurate of the blockchain simulators it is fairly slow. Does not simulate transactions. (https://github.com/arthurgervais/Bitcoin-Simulator)
- BlockSim: developed in Python. Supports simulating both Bitcoin and Ethereum. Accurate but slow. Simulates transactions and connection handshakes. (https://github.com/carlosfaria94/blocksim)
- SimBlock: developed in Java. In current version supports only Nakamoto Consensus. Plans on adding GHOST protocol. Fast. Does not simulate transactions. SimBlock partially inspired this project. (https://github.com/dsg-titech/simblock)
Any contributions you make to JABS project are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star. Thanks.
Steps for code contribution to the project:
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Habib Yajam - @habibyajam - [email protected]