bitcoin-explorer
bitcoin_explorer
is an efficient library for reading
bitcoin-core binary blockchain file as a database (utilising multi-threading).
This package is ported using pyO3 from rust library bitcoin-explorer
Installation
MacOS, Windows, and Linux wheels are provided.
Use pip install bitcoin-explorer
to install.
Documentation
This library has a Rust version, go to Rust Documentation
For python documentation, go to Documentation.
Compatibility Note
This package deals with the binary file of another software Bitcoin Core
.
It might not be compatible with older Bitcoin Core versions.
Currently, it is compatible with Bitcoin Core version
Bitcoin Core version v0.21.1.0-g194b9b8792d9b0798fdb570b79fa51f1d1f5ebaf Copyright (C) 2009-2020 The Bitcoin Core developers
.
Examples
It contains one class BitcoinDB
.
import bitcoin_explorer as bex
db = bex.BitcoinDB("~/Bitcoin")
db.get_block_count()
db.get_block(1000)
db.get_block(1000, connected=True)
db.get_hash_from_height(1000)
db.get_block_header(1000)
db.get_height_from_hash("some hash")
db.get_transaction("some txid")
db.get_height_from_txid("some txid")
db.parse_script("some hex script pubic key")
for block in db.get_block_iter_range(start=1000, end=2000):
do_something_with(block)
for block in db.get_block_iter_array(heights=[1, 3, 5, 7, 9]):
do_something_with(block)
for block in db.get_block_iter_range(end=700000, connected=True):
do_something_with(block)