This is a quick guide to getting started with Crypto.BI Toolbox.
Following these steps should get Toolbox in a working state quickly, so you can begin exploring the Bitcoin blockchain.
So, let's jump right into Toolbox setup!
Create a working directory where you'll download the source code to Bitcoin Core and Toolbox.
$ cd work_dir/ $ git clone https://github.com/bitcoin/bitcoin.git $ git clone https://github.com/cryptobi/toolbox.git
You may use the same working directory as Toolbox and Bitcoin Core.
Take note of all the build directories, you'll need them on the next step.
Now we can proceed to build Toolbox.
$ export BITCOIN_SRC_DIR=yourworkingdir/bitcoin $ export BOOST_SRC_DIR=yourworkingdir/boost-1.xxx $ export MYSQLCONN_DIR=yourworkingdir/mysql-connector.... $ export SPDLOG_DIR=yourworkingdir/spdlog-x.xx $ export FMT_DIR=yourworkingdir/fmt... $ cd yourworkingdir/toolbox $ mkdir build $ cd build $ cmake -DCMAKE_BUILD_TYPE=Debug -DFMT_DIR=$FMT_DIR -DSPDLOG_DIR=$SPDLOG_DIR -DMYSQLCONN_DIR=$MYSQLCONN_DIR -DCMAKE_VERBOSE_MAKEFILE=ON -DBOOST_SRC_DIR=$BOOST_SRC_DIR -DBITCOIN_SRC_DIR=$BITCOIN_SRC_DIR -DCB_BUILD_EXAMPLES=1 -DBUILD_TESTING=1 .. $ ninja -v
$HOME_DIRECTORY/.Crypto.BI/crypto.bi.ini file and fill the following fields:
[DEFAULT] db.user=yourdbuser db.host=localhost db.db=schemaname db.pass=yourdbpassword bitcoin_blocks_dir=/disk5/bitcoindata/blocks log_to_file=1 log_to_console=1
/disk5/bitcoindata/blocks for the correct path to your Bitcoin installation's
This step is the longest running one. Having a correctly built local database is essential to get accurate results.
First, generate the DB schema:
mysql -u username -p < scripts/sql/mysql/cryptobitoolbox_bitcoin.sql
Now, load data into the DB:
$ export CRYPTOBI_HOME=yourworkingdir/toolbox $ cd $CRYPTOBI_HOME # the next step might take from several hours to several days. # let it run completely, avoiding interruption $ ./toolbox/db/blocks_inserter --threaded 1 --threads 8 # if your system is overloaded by the multithreaded inserter, you can run it # in single thread mode as well (uncomment line): # $ ./toolbox/db/blocks_inserter $ cd $CRYPTOBI_HOME/python # the next two processes may also take a very long time # depending on your hardware setup $ python3 toolbox/bitcoin/build_blockchain.py $ python3 toolbox/bitcoin/build_address_graph.py
A clean database build is essential to get good results when analyzing the blockchain.
blocks_inserter can restart from the latest inserted blocks file, it is recommended that you run it from start to finish without interruptions.
Note: Tracing addresses on the blockchain will only work after running
toolbox/bitcoin/build_address_graph.py Querying blocks and TX's will work without the address graph.
Test some of the Crypto.BI python tools like
transaction_query.pyand so on.
New programs are being added all the time.
Check out the latest Crypto.BI version to access new tools.