Using BlockSci

After installing BlockSci and parsing a compatible blockchain, the analysis library is ready for use.

Python

To use BlockSci in Python, you only need to import the BlockSci library. Then, you can instantiate a blocksci.Blockchain object by pointing it to the config file.

import blocksci
chain = blocksci.Blockchain("path/to/your/config.json")

If you would like to use BlockSci through a web interface, we recommend the use of Jupyter Lab.

C++

In order to use the C++ library, you must compile your code against the BlockSci dynamic library and add its headers to your include path. The Blockchain can then be constructed given the path to the config file.

#include <blocksci/blocksci.hpp>

int main(int argc, const char * argv[]) {
        blocksci::Blockchain chain{"path/to/your/config.json"};
}

An easy way to get started is to modify the file example/example.cpp. Then, compile and run it as follows:

cd release
make blocksci_example
./example/blocksci_example <path to config>