GeoDecConsensus / geodec

Measure the cost of geographical decentralization.
Apache License 2.0
10 stars 2 forks source link
bullshark cometbft hotstuff tendermint

GeoDec

GeoDec aims to address the geographic concentration of validator nodes in existing blockchain networks, particularly in the context of PoS consensus mechanisms. The project involves the development of an emulator to analyze geospatial distribution.

Geodec is in active development. Please open an issue if you would like to contribute.

Table of Contents

Get Started

Pre-requisites

For cometbft you can use the binary (light weight and easy) \ For hotstuff you need to clone the repo and install cargo rust

Clone hotstuff

git clone https://github.com/GeoDecConsensus/hotstuff.git

Clone cometbft binary

# Download the tar.gz file using curl
curl -LO https://github.com/cometbft/cometbft/releases/download/v1.0.0-alpha.2/cometbft_1.0.0-alpha.2_linux_amd64.tar.gz

# Create a directory for cometbft
mkdir cometbft-dir

# Extract the tar.gz file into the newly created directory
tar xvf cometbft_1.0.0-alpha.2_linux_amd64.tar.gz -C cometbft-dir

# Move the cometbft binary to the current directory
mv cometbft-dir/cometbft ./

# Remove the downloaded tar.gz file and the directory
rm -r cometbft_1.0.0-alpha.2_linux_amd64.tar.gz cometbft-dir

Install rust (non-interactive)

curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
rustup default stable

Download Geodec

git clone https://github.com/GeoDecConsensus/geodec.git
cd geodec
pip install -r requirements.txt

How does it work?

Geodec supports the following consensus mechanisms:

Remote

The remote command is used to run the consensus mechanism on a cluster of n nodes.

fab remote <mechanism_name> # ["cometbft", "hotstuff", "bullshark"]

GeoRemote

The georemote command is used to run the consensus mechanism on a cluster of n nodes with added artificial latencies. The artificial latency is added to simulate the geographic distribution of the nodes. The latency data is taken from WonderProxy

fab georemote <mechanism_name> # ["cometbft", "hotstuff", "bullshark"]

File Structure

Demo

Demo of geodec running CometBFT with georemote and remote both.

https://github.com/GeoDecConsensus/geodec/assets/97289118/dcf9a365-8528-42f4-b7d4-de49a7162804

Maintainers

Naman Garg

Shashank Motepalli

Advisor: Arno Jacobsen

Contributing

Feel free to open issues, wait to receive confirmation from the maintainers before starting to work on it.

License

This project is licensed under the Apache License - see the LICENSE.md file for details.

Relevant Work

Credits

Thanks and credits to Alberto Sonnino for the initial hotstuff and bullsharks benchmark. Thank you PBS Foundation for supporting this work.