laanwj / blockdb-troubleshoot

Bitcoin block database troubleshooting tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

▄▚█▐▙▞█▖▙▐▜▚▖▌▗▟▌▗▐▟▗▌▖▚▟▌▄█▚█▜▌▟█▚▟▟▐▀▙ Collected bitcoin block database troubleshooting tools. ▐▟▌▀▜▗▘▙▝▛▛▄▝▙▚▟▜▚▚▌▝▙▘▟▞▞▞▗▞▞▙▘▙▛▜▟▐▗▙▙

Run ./compile_leveldb.sh to build the necessary leveldb.so python module, as well as leveldbutil.

Do not use existing python-leveldb with these tools! The internal library is specifically tweaked to be exactly like Bitcoin's. Using an external leveldb can result in the databases becoming incompatible with Bitcoin due to, for example, different compression settings or version drift.

dependencies

apt-get install python3-setuptools python3-dev

lmdb

EXPERIMENTAL

Run ./compile_lmdb.sh to build the lmdb module. This will use py-lmdb's internal lmdb module, not the system lmdb (if any).

./leveldb2lmdb.py /data/bitcoin/chainstate /data/bitcoin/chainstate2 $((1024*1024*1024*8))
./leveldb2lmdb.py /data/bitcoin/blocks/index /data/bitcoin/blocks/index2 $((1024*1024*1024*8)) 

About

Bitcoin block database troubleshooting tools


Languages

Language:C++ 50.2%Language:C 30.0%Language:Python 14.5%Language:HTML 3.1%Language:Makefile 1.3%Language:Shell 0.8%Language:CSS 0.1%Language:GDB 0.0%