Bitcoin Forum

Other => Beginners & Help => Topic started by: rolling on July 30, 2013, 12:53:57 AM



Title: Open the Blockchain in a Database
Post by: rolling on July 30, 2013, 12:53:57 AM
Can anyone tell me how to open the blockchain using a database program such as Access?  I apparently have the blockchain since I have bitcoin installed but I can not view it in anything but the native program.  I tried importing the dat files but couldn't.


Title: Re: Open the Blockchain in a Database
Post by: i3lome on July 30, 2013, 01:11:37 AM
can you just use blockchain.info to get the information you need


Title: Re: Open the Blockchain in a Database
Post by: rolling on July 30, 2013, 01:17:14 AM
I want the whole blockchain.  It would take years viewing 1 block at a time.


Title: Re: Open the Blockchain in a Database
Post by: lmn123 on July 30, 2013, 01:31:24 AM
Correct me if I'm wrong, but isn't the blockchain stored as plaintext? Can't you just view it by concatenating all the blockXX.dat files in the "~/.bitcoin/blocks" folder and just view them with a text viewer?


Title: Re: Open the Blockchain in a Database
Post by: rolling on July 30, 2013, 01:34:44 AM
I just get a bunch of scrambled characters.


Title: Re: Open the Blockchain in a Database
Post by: lmn123 on July 30, 2013, 11:16:10 AM
Shoot I do too. Why did I think those were plaintext? Somebody who knows better will have to help.


Title: Re: Open the Blockchain in a Database
Post by: whault on July 30, 2013, 11:46:53 AM
The blocks are stored in something called LevelDB, which is already a very capable database format. While you wouldn't have any fun opening it up in Excel (it's 10GB afteral), you can use a python application named Abe to throw it all into a Postgres/MySQL database if you really insist. I would personally advise against it though.

https://github.com/jtobey/bitcoin-abe