For local tests, checkout to branch local
git checkout local
NOTE: A working internet connection is required since the pbft nodes have to pull the specified project
Start the pbft network and the client with example configuration:
# start the client using example configuration
./scripts/startClient.sh
# start the network using example configuration
./startNetwork.sh
Trigger a call by posting a request. This process imitates a webhook. Two test projects have been created for testing.
For the first one, TARGET_BRANCH may be
- master
- feature
For the second one, TARGET_BRANCH may be
- master
If the specified branch does not exist, the network will still work (returning an err code). Assuming the client listens on port 8080:
curl --header "Content-Type: application/json" --request POST --data '{"branch":"TARGET_BRANCH", "repoCloneUrl":"TARGET_REPO"}' http://localhost:8080/webHook
Stop the network: Client has to be shut down manually.
# stop the network
./stoptNetwork.sh
Inspect the logs in ./log
If you want to customize the configuration, the help option might be insightful
# change directory to root of the project
# get more information about client
python ./client/index.py -h
# get more information about node
python ./node/index.py -h
The pbft network needs needs 3 f + 1 nodes in order to work properly! The prototype was tested using 4 nodes (assuming at max one node is faulty)
- python 3.9.1
- aiohttp 3.7.3
- pycryptodome 3.9.9
- docker (Tested on windows Docker: version 20.10.2, build 2291f61)
You can check your dependencies in a shell:
python --version # should print 3.9.1
docker --version
NOTE: On windows, virtualization has to be enabled for docker to work.
The modules can be installed with
pip install -r requirements.txt
Test if it did work:
python -c "import aiohttp; print(aiohttp.__version__)" # should print 3.7.3
python -c "import Crypto; print(Crypto.__version__)" # should print 3.9.9
NOTE: You might want to consider using virtual environments if you have already installed the above modules with a different version.
You might want to read the following papers to gain more insight on the pbft algortihm
- The Byzantine Generals Problem (introduction to bft)
- Practical Byzantine Fault Tolerance (about the pbft algorithm)