I'm building a basic analytics framework for the Ethereum blockchain. As a first step I need to extract the data and I'd like to do this in Python. I've been using Geth as a client on OSX and so, as far as I understand, the blockchain is stored locally at ~/Library/Ethereum/chaindata
in LevelDB, i.e. in binary files like 496355.ldb
.
How do I parse the
.ldb
files? Is there a Python library I can use for this? I've looked at pyethereum but am not sure where to look as the documentation is pretty sparse.I can use the etherchain.org API but this would involve many API calls and will probably make the good people at etherchain.org unhappy. This is why I prefer to parse the blockchain as stored locally on my machine. But ignoring this problem for a moment, does anyone know a short guide to the result of an API call for transaction data resulting in data like this:
{'accountNonce': '200642', 'amount': 2678970350000000000, 'blockHash': '0x47525d00eab0dcd87e9f8b0e9de2fe9f553f72576ef4f892ace49b2832e985bd', 'block_id': 1039153, 'gasLimit': 21000, 'hash': '0x41bb75d8b20ae7e23fa7457d21a30a4007d0eb97fdb887caac834b759eeb3572', 'isContractTx': None, 'newContract': 0, 'parentHash': '0x41bb75d8b20ae7e23fa7457d21a30a4007d0eb97fdb887caac834b759eeb3572', 'price': 50000000000, 'recipient': '0x30906581413d556de1a018adbe6cc63c88d58512', 'sender': '0x2a65aca4d5fc5b5c859090a6c34d164135398226', 'time': '2016-02-21T18:53:56.000Z', 'txIndex': None}
I believe I understand most of this data but would really appreciate more information to fill in the gaps of my understanding.