- Python 3.7
pipenv
(pip install pipenv
)- In case there is an error such as
module is not callable
in the install phase, downgrade pippip install pip==18.0
andpipenv run pip install pip==18.0
- In case there is an error such as
- Rust's cargo if you want to run simulations.
In this case, don't use repo as-is but use core-cbc:
git clone core-cbc
,git submodules init
,cd visualization
)
pipenv install
pipenv run jupyter notebook
- If the figure is not interactive, you may have to re-run all cells (manually?) to activate the interactive mode.
- Install tcl/tk
sudo apt-get install tk
orsudo pacman -S tk
pipenv run python visualization.py
orpipenv run python process_metrics.py
pipenv run python visualization_metrics.py
-
process_metrics.py
Process allstats*.log
files located in the parent folder. Outputs two files:gen.csv
which contains data points each time a validator reaches a new consensus height.gen_averages.csv
which is the average for all values for all validators for each run.
-
aggregate.sh
Aggregates all the csv files located in./generated/backup/
that start with the prefixed passed as argument. Output files are./gen.csv
and./gen_averages.csv
. -
start_testing.sh
starts multiple runs of theblockchain
integration test. saves all the log files, as well as thegen.csv
andgen_averages.csv
. parameters:prefix
: prefix of the log filesnb_jobs
: number of rust testing jobs
example:
./start_testing.sh double_round_robin 8
-
process.sh
Extracts blockchain view from a singleblockchain
integration test run. Extracted json files are saved into./generated/processed_states*.log
-
visualization.py
Shows blockchain views contained ingenerated/processed_states*.log
If you want to run simulations:
- Go to
../tests/generative_tests.rs
- In the
fn blockchain()
test, in therunner.run
function: Change parameters, such as height, receiver strategy, sender strategy, consensus height, number of nodes.
- In the
- In the
start_testing.sh
script: change the number of executions in the main function. - Run
start_testing.sh prefix core
and go grab a coffee. You should now have a bunch ofgen*.csv
files ingenerated/backup/
- Run
aggregate.sh prefix
to aggregate all the files ingenerated/backup/
- You can now visualize the data using the next chapter
- Launch jupyter
pipenv run jupyter-notebook
- This opens jupyter in your browser.
- Open the
visualization_metrics.ipynb
in jupyter - If you want to see all the graphs with the data available on the repository:
- Click
Kernel>Restart and Run All
- Click
- If you want to show data that are just out of your simulations:
- Change
if False
intoif True
in the second cell. - Run the two first cells of the notebook. (Shift-Enter)
- Change