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.
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
git clone https://github.com/GeoDecConsensus/geodec.git
cd geodec
pip install -r requirements.txt
Geodec supports the following consensus mechanisms:
The remote
command is used to run the consensus mechanism on a cluster of n
nodes.
fab remote <mechanism_name> # ["cometbft", "hotstuff", "bullshark"]
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"]
Run data
cometbft-config.toml
- For any custom configuration for the cometbft consensus mechanism if needed.ip_file.csv
- Contains the IP addresses of the node instances.geo-input.csv
- Tells the artificial location of the nodes. The first column ID - server id and the second column Count - number of nodes in that location.servers.csv
- Contains the geographical data of servers. NO NEED TO CHANGE THIS FILE.ping_grouped.csv
- Contains the latency data of the servers. NO NEED TO CHANGE THIS FILE.fab-param.json
- Contains the bencha and node parameters for the consensus mechanism. Used in the fabfile.py
file.
fabfile.py
- Contains the fabric commands like install, remote, georemote. NO NEED TO CHANGE THIS FILE.
settings.json
- Contains the settings related to locations of keys, file, ports, etc.
persistent.sh
- Bash script to generate the persistent peers for the cometbft. NO NEED TO CHANGE THIS FILE.
Demo of geodec running CometBFT with georemote and remote both.
https://github.com/GeoDecConsensus/geodec/assets/97289118/dcf9a365-8528-42f4-b7d4-de49a7162804
Advisor: Arno Jacobsen
Feel free to open issues, wait to receive confirmation from the maintainers before starting to work on it.
This project is licensed under the Apache License - see the LICENSE.md file for details.
Thanks and credits to Alberto Sonnino for the initial hotstuff and bullsharks benchmark. Thank you PBS Foundation for supporting this work.