Giter VIP home page Giter VIP logo

luckydonald / pbft Goto Github PK

View Code? Open in Web Editor NEW
135.0 5.0 45.0 2.33 MB

Implementation of the Practical Byzantine Fault Tolerant Algorithm (pbft)

Home Page: https://github.com/luckydonald/pbft

License: GNU General Public License v3.0

Python 22.48% HTML 41.43% CSS 8.16% JavaScript 22.59% Makefile 0.11% Shell 0.21% Dockerfile 0.38% Less 4.64%
pbft web-gui docker java python api beautiful byzantine-fault-tolerance coverage-status java-node

pbft's Introduction

pbft

Implementation of the Peters Practical Byzantine Fault Tolerant Algorithm    

Web GUI

This project supports a web interface to b e a u t i f u l l y represent what's going on.

You'll get a overview over all the values the nodes measured.

image

You can also get insight which messages get send by which node to which node.

image

Code status

Please note, the project for which this was made for has reached an end, so the code will not be actively maintained any longer. However, pull requests with fixes and improvements will be merged. Have a look into the bugtracker, if someone else had a similar issue, and already made it work.

Java PBFT Node

Build Status Coverage Status

API Server

Build Status Coverage Status

Get the Code

git clone --recursive https://github.com/luckydonald/pbft.git

If you forget --recursive, the phppgadmin container won't be available.

Starting everything

You need Docker installed.

$ docker-compose build

Because some services need longer to start it is best to start them in the following order:

  1. Database and Database browser

    $ docker-compose up -d postgres postgres_browser
  2. The API

    $ docker-compose up -d api 
  3. Start the web GUI

    $ docker-compose up -d web
  4. Scale the nodes to use e.g. 4 instances

  • a) Older compose syntax
    $ docker-compose scale node=4
  • b) Newer compose syntax
    docker-compose up --scale node=4
  1. Start the nodes

    $ docker-compose up -d node
  2. Stop & reset everything

    $ docker-compose down

Standart Ports and URLs

Assuming your docker is publishing it's ports on localhost.

Server URL
API http://localhost:80/
Database http://localhost:8080/phppgadmin/
Web GUI http://localhost:8000/src/

Links

The whole project: https://github.com/luckydonald/pbft

The Java node implementation: https://github.com/luckydonald/PBFT-JAVA

DB Struktur (for debugging and powering the web gui): https://editor.ponyorm.com/user/luckydonald/pbft pbft database structure

pbft's People

Contributors

luckydonald avatar playingbacon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pbft's Issues

how to use

I run as README but get a blank web page:
image

So how to add nodes or commits? Could you demonstrate or add it to README?
Thanks.

Database: include sent to host

Add a string field containing the hostname, the node would sent too
Or do we only store once per broadcast?
Store if sending to specific nodes failed?


Reported by _**Luckydonald [@luckydonald](http://telegram.me/luckydonald)**_

Starting Everything 4th step

I have problem when following the instructions of Starting everything:
The 4 th step:
$ docker-compose scale node=4

error message as follow:
szlee118@DESKTOP-BUB68TV:~/pbft$ docker-compose scale node=4
WARNING: The API_HOST variable is not set. Defaulting to a blank string.
WARNING: The scale command is deprecated. Use the up command with the --scale flag instead.
Starting pbft_node_1 ...
Starting pbft_node_2 ...
Starting pbft_node_3 ...
Starting pbft_node_4 ...

ERROR: for pbft_node_2 a bytes-like object is required, not 'str'

ERROR: for pbft_node_1 a bytes-like object is required, not 'str'

ERROR: for pbft_node_3 a bytes-like object is required, not 'str'

ERROR: for pbft_node_4 a bytes-like object is required, not 'str'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.22/containers/69e5ca8729102b1a9c1eb30fd090d599661934957fcb207318159247e6825e74/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container
container.start()
File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start
return self.client.start(self.id, **options)
File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start
self._raise_for_status(res)
File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status
raise create_api_error_from_http_exception(e)
File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("b'OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/usr/lib/jvm/java-8-openjdk-amd64/bin/java\": stat /usr/lib/jvm/java-8-openjdk-amd64/bin/java: no such file or directory": unknown'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in
load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')()
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main
command()
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command
handler(command, command_options)
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 933, in scale
self.project.get_service(service_name).scale(num, timeout=timeout)
File "/usr/lib/python3/dist-packages/compose/service.py", line 305, in scale
self._execute_convergence_start(
File "/usr/lib/python3/dist-packages/compose/service.py", line 506, in _execute_convergence_start
_, errors = parallel_execute(
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
raise error_to_reraise
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
result = func(obj)
File "/usr/lib/python3/dist-packages/compose/service.py", line 508, in
lambda c: self.start_container_if_stopped(c, attach_logs=not detached, quiet=True),
File "/usr/lib/python3/dist-packages/compose/service.py", line 620, in start_container_if_stopped
return self.start_container(container)
File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container
if "driver failed programming external connectivity" in ex.explanation:
TypeError: a bytes-like object is required, not 'str'

Is the error in any relation with "API_host variable is not set" and where is the API_host variable should be set?
Has anyone faced similar issues before and can offer some hints?
Sorry to bother you, thank you and appreciated for help!

[Build Error] Fail to build at step 6 (postgres_browser)

when i try to get your project from docker,i meet the question i don't know how to do. what should i do?please help .
the error is :

Step 6/29 : RUN echo "deb http://packages.dotdeb.org  squeeze all" >> /etc/apt/sources.list.d/dotdeb.org .list && 	echo "deb-src http://packages.dotdeb.org  squeeze all" >> /etc/apt/sources.list.d/dotdeb.org .list && 	wget -O- http://www.dotdeb.org/dotdeb.gpg  | apt-key add ----> Running in 332002fc783c
--2018-03-10 13:12:25--  http://www.dotdeb.org/dotdeb.gpg Resolving www.dotdeb.org  (www.dotdeb.org )... E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
195.154.242.153 , 2001:bc8:21eb:100::1
Connecting to www.dotdeb.org  (www.dotdeb.org)|195.154.242.153|:80 ... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5299 (5.2K) [application/octet-stream]
Saving to: 'STDOUT'

     0K                                                         0% 0.00 =0s


Cannot write to '-' (Broken pipe).
ERROR: Service 'postgres_browser' failed to build: The command '/bin/sh -c echo "deb http://packages.dotdeb.org  squeeze all" >> /etc/apt/sources.list.d/dotdeb.org .list && 	echo "deb-src http://packages.dotdeb.org  squeeze all" >> /etc/apt/sources.list.d/dotdeb.org .list && 	wget -O- http://www.dotdeb.org/dotdeb.gpg  | apt-key add -' returned a non-zero code: 255

Relation

 Sorry to bother you. I ran it according to readme,but it failed in the step 4.What the error showed is described in the picture.I have installed the java-8-openjdk-amd64, and the path is the same as the what showed in the error. Additionaly,I have configured the JAVA_HOME and the PATH,so the "java" command is valid.Hence, I do not know what happended,need your help.

1

step 5 docker-compose up -d node

when I want repeat on Ubuntu 18.04
I get this error:

docker.errors.APIError: 400 Client Error: Bad Request ("b'OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/lib/jvm/java-8-openjdk-amd64/bin/java": stat /usr/lib/jvm/java-8-openjdk-amd64/bin/java: no such file or directory: unknown'")

when I run step 4 :docker-compose scale node=4 get error ,I try step over this step

but step five alse have this question ?

@luckydonald
can you give me any suggestion

Algorithm hanging

Not quite sure why that happens.
Most of the times after the sending of the InitMessages.

Does the python version node still available?

I want to learn the python version pbft and change your docker-composer.yml, from
node:
extends:
file: code/node_java/docker-compose.yml
service: node_java
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
NODE_DEBUGGER: "False"
NODE_DEBUG: "False"
# API_HOST: "http://192.168.0.42"
API_HOST: ${API_HOST}

to

node:
extends:
file: node.docker-compose.yml
service: node
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
NODE_DEBUGGER: "False"
NODE_DEBUG: "False"
# API_HOST: "http://192.168.0.42"
API_HOST: ${API_HOST}

and when I run docker-compose build, it has something wrong with installing the posrgres-browser like:
image

is there any way to solve this problem?

Database: include sent to host

Add a string field containing the hostname, the node would sent too
Or do we only store once per broadcast?
Store if sending to specific nodes failed?


Reported by _**Luckydonald [@luckydonald](http://telegram.me/luckydonald)**_

please help me

every thing is up but there is no motion or data i can take from the program what ican do am making auditing on the code so please help me to make this better

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.