Name: cbc-casper
Owner: ethereum
Description: null
Created: 2017-02-22 17:20:11.0
Updated: 2018-05-18 18:13:13.0
Pushed: 2018-04-30 13:55:55.0
Homepage: null
Size: 771
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Branch | Tests ———-|—— master | develop |
A python implementation of a class of “correct-by-construction” consensus protocols. Currently, this includes Casper the Friendly Ghost (a blockchain consensus protocol) and Casper the Friendly Binary Consensus Protocol.
Specifications for these protocols can be found here here, but the implementation and the spec may deviate from the spec, as they are still moving targets.
This pre v1.0 implementation is under active development and experimentation and might experience significant organizational and substantive changes. If you use components of this codebase, expect breaking changes to be introduced.
That said, we will try to detail any breaking changes in subsequent releases.
sudo apt-get install python3-dev python3-venv python3-tk
brew install python3
If you would like to hack on cbc-casper or run the simulations yourself, setup your dev environment with:
install
NOTE: If you prefer to manage venv explicitly, run a standard venv setup and
pip install using requirements.txt
Standard simulations are marked up for use as follows:
run-[binary | blockchain | concurrent | integer | order | sharding]
Each protocol represents consensus on a different data structure.
Optionally, you can add a message passing mode to each protocol. For example,
run-binary MODE=rrob
There are currently three message passing modes:
rand:
each round, some randomly selected validators propagate their most recent message to other randomly selected validators, who then create new messages.
rrob:
each round, the creator of the last round's block sends it to the next receiver, who then creates a block.
full:
each round, all validators receive all other validators previous messages, and then all create messages.
By default, a gif and associated images of the simulation will be saved in graphs/graph_num_0/
. These settings can be modified, along with the number of validators, the number of messages that propagate per round, and the report interval in the config.ini
.
Advanced simulations can be run with a little command line wizardy.
. venv/bin/activate
casper.py
. The following are example usages:t help and all options for casper.py
on casper.py --help
python casper.py –protocol blockchain –msg-mode rand –validators 100
python casper.py –protocol blockchain –msg-mode rand –display false –save true
python casper.py –protocol blockchain –msg-mode rrob –validators 6 –rounds 300 –report-interval 100
rite Simulations
NG SOON...
un Tests
un all tests:
make test
un a specific test, use (or the equivalent for whatever test you wish to run)
make test TEST=tests/test_safety_oracle.py
un tests with visualizations:
make test-with-reports
: each view graph must be closed for the tests to continue running.