Package: btl-cd-release-test
Consensus Blockchain DecentralizationThis repository provides a CLI tool for analyzing the block production of various blockchains and measuring their
subsequent levels of decentralization. Please refer to the project'sdocumentation pagesfor details on its architecture,
required input, produced output, and more.Currently, the supported blockchains are:BitcoinBitcoin CashCardanoDogecoinEthereumLitecoinTezosZcash
We intend to add more ledgers to this list in the future.InstallationTo install the tool, simply clone this project:git clone https://github.com/Blockchain-Technology-Lab/consensus-decentralization.gitTherequirements filelists the dependencies of the project.
Make sure you have all of them installed before running the scripts. To install
all of them in one go, run the following command from the root directory of the
project:python -m pip install -r requirements.txtRun the toolPlace all raw data (which could be collected fromBigQueryfor example) in theraw_block_datadirectory, each file named as<project_name>_raw_data.json(e.g.bitcoin_raw_data.json). By default, there
is a (very small) sample input file for some supported projects. To use the
samples, remove the prefixsample_. For more extended raw data and instructions on how to retrieve it, seehere.Runpython run.py --ledgers <ledger_1> ... <ledger_n> --timeframe <timeframe>to produce a csv of the mapped data.
Note that both arguments are optional, so it's possible to omit one or both of them (in which case the default values
will be used). Specifically:Theledgersargument accepts any number of supported ledgers (case-insensitive).
For example,--ledgers bitcoinruns the analysis for Bitcoin,--ledgers Bitcoin Ethereum Cardanoruns the analysis
for Bitcoin, Ethereum and Cardano, etc. Ledgers with  more words should be defined with an underscore; for example
Bitcoin Cash should be set asbitcoin_cash.Thetimeframeargument should be of the formYYYY-MM-DD(month and day can be omitted).
For example,--timeframe 2022runs the analysis for the year 2022,--timeframe 2022-02runs it for February 2022,
etc.run.pyprints the output of each implemented metric for the specified ledgers and timeframe.To mass produce and analyze data, omit one or both arguments. If only theledgersis given, all data since January 2018 for the given ledgers will be
analyzed. If only the timeframe is specified, all ledgers will be analyzed for
the given timeframe. If no arguments are given, all ledgers will be analyzed for
all months since January 2018.Three filesnc.csv,gini.csv,entropy.csvare also created in theoutputdirectory, containing the data from the
last execution ofrun.py.ContributingEveryone is welcome to contribute ideas, report bugs, and make the code more efficient. We especially welcome contributions to the following areas:Add support for a ledger that is not already supported.Update and/or add mapping information for a ledger.Add a new metric.For detailed information on how to contribute see the relevantdocumentation
page.MaintainersThe tool is actively maintained by the following developers:Dimitris KarakostasChristina OvezikNote: When opening a Pull Request, you must request a review from at least2people in the above list.LicenseThe code of this repository is released under theMIT License.
The documentation pages are released underCC BY-SA 4.0.