In this post, I’ll walk you through installing BlockSci and converting the raw blockchain into a format that we can use in C++ and Python3 (with or without Jupyter).

First, download and install BlockSci.  Follow the instructions on the installation page and when you get to the end, you might run into a few issues.

When you get to the last few steps of the install and build - these steps:

cd libs/bitcoin-api-cpp
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install

cd ../../..
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install

You might get an error that looks something like this:

/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20′ not found

If this happens, then you might have the same issue I did.  I fixed it by doing the following:

  1. go to the right location and backup your current anaconda3 shortcut (change its name so it isn’t overwritten):
    cd ~/anaconda3/lib
    mv -vf libstdc++.so.6 libstdc++.so.6.old
    
  2. create a new shortcut using the ln command (I am assuming that I am in the previous location ~/anaconda3/lib):
    ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./libstdc++.so.6

After performing the steps above, re-attempt the affected build. I also had to use conda instead of pip to install these libraries:

Instead of:
sudo -H pip3 install –upgrade multiprocess psutil jupyter pycrypto matplotlib pandas dateparser

I used:
conda install multiprocess psutil pycrypto matplotlib pandas dateparser

And everything worked fine.

CONVERTING THE BLOCKCHAIN FOR ANALYSIS

Now that you have a full Bitcoin node, a synchronized blockchain, and the BlockSci packages built and installed, it’s time to convert the blockchain data into a format that’s more easily used for analysis.  This is the command to run:

blocksci_parser –output-directory bitcoin-data update disk –coin-directory .bitcoin

This will take at least several hours to run, if not a whole day.

If you have any questions or find any errors, please let me know and I’ll do my best to help you.  In the next post, we’ll start analyzing the blockchain with Jupyter and Python.

And thanks, again, for reading!