Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Of transactions in the Bitcoin blockchain
The Bitcoin blockchain is a ledger of transactions, grouped into blocks that have been verified together.
The steps below describe how to use SPADE's Bitcoin reporter to ingest the blockchain.
The reference implementation of Bitcoin must be installed.
On Ubuntu 14.04, Bitcoin can be installed with:
sudo apt-add-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install bitcoind
On Mac OS X, Bitcoin can be installed with:
curl -O https://bitcoin.org/bin/bitcoin-core-0.11.2/bitcoin-0.11.2-osx64.tar.gz tar xvf bitcoin-0.11.2-osx64.tar.gz echo $PWD/bitcoin-0.11.2/bin > $SPADE/cfg/bitcoin.path
$SPADE is set to SPADE's top-level directory.
Configure and run the Bitcoin daemon,
mkdir ~/.bitcoin cp $SPADE/cfg/bitcoin.conf ~/.bitcoin/bitcoin.conf bitcoind
Since initialization can take a significant period of time, its progress can be monitored with:
Ingesting the blockchain
The Bitcoin reporter can be started using SPADE's controller:
-> add reporter Bitcoin
The reporter will connect to
bitcoind and start downloading blocks from the genesis block (which has height 0). The blocks and transactions will be represented as data provenance using the W3C PROV data model. Details of the key-value annotations are available here.
Since ingestion of the entire blockchain can take days even on a server, the reporter supports collection of a limited set of blocks. This can be done using the optional arguments
end. For example, to ingest the blocks with height 10, 11, and 12, the reporter can be started with:
-> add reporter Bitcoin start=10 end=12
end argument is not provided, the reporter will continue ingesting new blocks as they become available from the Bitcoin daemon.
To stop collecting Bitcoin blocks, use this command in SPADE's controller:
-> remove reporter Bitcoin