Title: opening the database with Perl Post by: grondilu on January 01, 2012, 09:51:44 AM I can see in the bitcointools 's python code that database are DB_BTREE, so I tried: Code: use DB_File; but this gives me only one line: main: 4 What am I missing? I can understand the the data is a bit serialized or something but I had expexted to have at least a bigger entry. Title: Re: opening the database with Perl Post by: 2112 on January 01, 2012, 10:58:25 AM main: 4 All Berkeley DB database files in Satoshi client are "multiple database capable". In effect they are B-trees of B-trees, where top-level B-tree contains only one node with key "main".What am I missing? I don't know how to get to the 2nd-level B-tree in Perl. Probably it is documented somewhere. Title: Re: opening the database with Perl Post by: grondilu on January 02, 2012, 10:39:12 AM I finally managed to open the database using the BerkeleyDB module instead of DB_File.
In short: Code: tie my %blkindex, 'BerkeleyDB::Btree', I still have to figure out the equivalent of the 'cursor.set_range("\x0ablockindex")' in Gavin's bitcointools, though. |