This is project was implemented as a part of course for Distributed Systems (Fall 2018) at Stony Brook University, under the guidance of Professor Annie Liu.
- Python (3.5)
- DistAlgo (https://github.com/DistAlgo)
- D3.js
- Shell
constants.py
This contains few of the adjustable parameters such as DIFFICULTY, BLOCKCHAIN_LENGTH etc. which can be adjusted to get different results when running the blockchain
- Execute
run.sh
to start the blockchain.
By default 5 miners are run which mine the transactions produced by 2 nodes. Each transaction produced by the nodes have a sleep time of 1s. This is because when the difficulty is increased to a larger number, too many tranasactions are pending while the proof of work is being done, which causes buffer overflow. To avoid this, we need to increase the sleep time in node.da when we are increasing the difficulty substantially.
- Open
visualize.html
in your web-browser to analyze the blockchain.
Use Zoom-out
functionality in the browser to see all 5 blockchains together. You can also hower over each node to see its transactions and previous hash.
The red color node is the genesis/starting block.
As we can see there are many forks which are occurring due to low difficulty.
The number of forks were reduced to 1 on increasing difficulty to 15.
- https://github.com/bitcoinbook/bitcoinbook
- https://github.com/Blockchain-for-Developers/merkle-tree/blob/master/merkle_tree.py
- https://github.com/koshikraj/justblockchain
- Shubham Jindal
- Arun Swaminathan