Giter VIP home page Giter VIP logo

pbft-poc's Introduction

PBFT / CI: Proof-of-Concept

Usage

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

Customization

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)

Dependencies

  • 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.

Literature

You might want to read the following papers to gain more insight on the pbft algortihm

pbft-poc's People

Contributors

ktrany avatar

Watchers

 avatar

pbft-poc's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.