Author

Topic: Is the blockchain available somewhere as one giant JSON object? (Read 1608 times)

legendary
Activity: 1526
Merit: 1134
You don't have to parse BDB files to read the block chain. In fact the block chain isn't stored in a Berkeley DB, only an index is.

The blk0001.dat files are concatenated block messages with some goop between them. You could read them directly.

Alternatively, use something like bitcoinj and connect to a local peer. You'll get Java objects back representing the parsed block chain.

The block chain is an inherently binary data structure. You need to be comfortable working with binary or else you won't get very far.
legendary
Activity: 1498
Merit: 1000
https://github.com/jtobey/bitcoin-abe probably what you want, it is in python
jr. member
Activity: 33
Merit: 7
Quote
what is better than learning about the blockchain how to convert a Bdb into a JSON Array Smiley (cause that makes better sense than a JSON object) btw a JSON array representation of the blockchain would be a disaster, and would be super long, remember the blockchain is now ~2.8gb so a JSON array of objects of the blockchain WOW that would not run good in php. Good luck with that

I'd really be happy with any "reasonably plain-text-ish" representation - JSON (object or array) is just the obvious leading candidate. This is of course, exactly as you say, a lot less space- and time-efficient to handle than a binary format (Berkeley DB in the Satoshi client, perhaps other binary formats in other clients). But it, uh, postpones my day of reckoning (of having to master Bdb)  Cheesy

(Just to clarify: I wouldn't be trying to respond interactively and quickly to web requests for a chart or whatever - I wouldn't be competing with the marvellous charts at https://blockchain.info/charts. I'd just like to analyse the blockchain [in various ways that go a bit beyond those charts] offline, at leisure, for my own interest. So, for now at least, efficiency is not so important for me!)
jr. member
Activity: 33
Merit: 7
Hello folks... is the blockchain available somewhere as one giant JSON object? I'd like to try my hand at some analysis of its structure (bitcoin days destroyed, lengths of txout/in/out/in chains, that sort of thing), and the Satoshi client's Berkeley DB format is utterly beyond me.
Jump to: