- Python 3.7
pipenv(pip install pipenv)- In case there is an error such as
module is not callablein the install phase, downgrade pippip install pip==18.0andpipenv 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 tkorsudo pacman -S tk
pipenv run python visualization.pyorpipenv run python process_metrics.pypipenv run python visualization_metrics.py
-
process_metrics.pyProcess allstats*.logfiles located in the parent folder. Outputs two files:gen.csvwhich contains data points each time a validator reaches a new consensus height.gen_averages.csvwhich is the average for all values for all validators for each run.
-
aggregate.shAggregates all the csv files located in./generated/backup/that start with the prefixed passed as argument. Output files are./gen.csvand./gen_averages.csv. -
start_testing.shstarts multiple runs of theblockchainintegration test. saves all the log files, as well as thegen.csvandgen_averages.csv. parameters:prefix: prefix of the log filesnb_jobs: number of rust testing jobs
example:
./start_testing.sh double_round_robin 8 -
process.shExtracts blockchain view from a singleblockchainintegration test run. Extracted json files are saved into./generated/processed_states*.log -
visualization.pyShows 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.runfunction: Change parameters, such as height, receiver strategy, sender strategy, consensus height, number of nodes.
- In the
- In the
start_testing.shscript: change the number of executions in the main function. - Run
start_testing.sh prefix coreand go grab a coffee. You should now have a bunch ofgen*.csvfiles ingenerated/backup/ - Run
aggregate.sh prefixto 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.ipynbin 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 Falseintoif Truein the second cell. - Run the two first cells of the notebook. (Shift-Enter)
- Change