High Performance Blockchain Deserializer
Project description
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
# parse the same path as `--datadir` argument for `bitcoind`.
db = bex.BitcoinDB("~/Bitcoin")
# get the length of the longest chain currently on disk.
db.get_max_height()
# get block of a certain height
db.get_block(1000)
# to retrieve the connected outputs of each inputs as well.
# note that this is inefficient.
# Use `get_block_iter_range(end, connected=True)` for better performance.
db.get_block(1000, connected=True)
# get block hash of a certain height.
db.get_hash_from_height(1000)
# a fast method for getting just the header.
# in memory query, no disk access
db.get_block_header(1000)
# get block of height 1000.
db.get_height_from_hash("some hash")
# get transaction from txid.
# This queries the `levelDB` each time, thus it is relatively slow.
db.get_transaction("some txid")
# get the height of the block which this transaction belongs.
db.get_height_from_txid("some txid")
# get the script type and addresses from a script public key
db.parse_script("some hex script pubic key")
# use iterator
for block in db.get_block_iter_range(start=1000, end=2000):
do_something_with(block)
# use iterator, iterate over heights
for block in db.get_block_iter_array(heights=[1, 3, 5, 7, 9]):
do_something_with(block)
# use iterator, connect outpoints
for block in db.get_block_iter_range(end=700000, connected=True):
do_something_with(block)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for bitcoin_explorer-1.0.4-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7828fc152fff94c37fd9bb6e74c5f8615faceefbc66895fff36cbc57a5b5a9d |
|
MD5 | 2b1b07f299d68ffeb4d9f65cc3a1fcd7 |
|
BLAKE2b-256 | 5f58ea574ec5fb730b90760a46c34793883ab754710ae0edc2b6bbcb044d26d7 |
Hashes for bitcoin_explorer-1.0.4-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4aad55f2a69136be57ea91c097f462611e5912480696b9420d93e1f03659f07 |
|
MD5 | e997202339198830c345e4396cd102b0 |
|
BLAKE2b-256 | 2e770fd760151d28109ef13ce941db1a853fc2aa57329d2d85799879db560c52 |
Hashes for bitcoin_explorer-1.0.4-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 511f159ddd0725593113b4d6dcd5e2fb0cbbf4183f1e9f6a71c7dc0ae390cf48 |
|
MD5 | 4294f6ac9a4a5e0e7b100c4d16226222 |
|
BLAKE2b-256 | 49d29cec5c795051106580b721f588abaf8acd54d860c4f4e5279b9663fbfc9f |
Hashes for bitcoin_explorer-1.0.4-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d6a96d9fe090020d969c5f71f5bf284f35d66d681911bd24d61048d8d2cca0 |
|
MD5 | 983bb772f1136864af80e009b7770ced |
|
BLAKE2b-256 | e619d22cc9f8a58c78832574b82ef6114b2e6459fc40734a6a6d7ddd8b6e3807 |
Hashes for bitcoin_explorer-1.0.4-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea73f6000660ee5791d5e4195e32c4b038ec821c0b81c9ff92131ed524ce70cc |
|
MD5 | 3b1aa6fd640a4b0939c39edf7ca4be49 |
|
BLAKE2b-256 | 51073c2552f8718580dbe6a58fb414742cdff2edef9fb07a2a849f1f344a301f |
Hashes for bitcoin_explorer-1.0.4-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73ce2a331ad65f45c0bdad37f59c7d703443e287e048d5ac5c5696f3f0770d2a |
|
MD5 | bf1451ef43f92f3a4b697f240b4eabc8 |
|
BLAKE2b-256 | fe21104af4792532ce519ff20707ffde6d52ec9b12fba642a4822c4c347f00ce |
Hashes for bitcoin_explorer-1.0.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632091a855a45a11b7c4e4c0ac7c6df5026ce89c10699c3745134a84c0b329c5 |
|
MD5 | f429f7de636108e0a3a59fd663cd14ac |
|
BLAKE2b-256 | 6e6fb0b73e01ff8a45b630d2b3c867c498f949cb37948bb58620518a305f76f4 |
Hashes for bitcoin_explorer-1.0.4-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5671492500be85e403aa71a566c545446e56b44468e9b8f3218dc0e9e98f3e |
|
MD5 | a7d8dbf5361dd28328612ba42c5bf746 |
|
BLAKE2b-256 | 7ff8b45deb114332e8d44ecc3495f3e3cd9b7e881a6b5cd44ef0ad42382e0c49 |
Hashes for bitcoin_explorer-1.0.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 174dcade3c5f845d3bce71d8173916e5d6bbb25282c72df5ec73e1e6bf78b030 |
|
MD5 | 3b780d406079baaba360db086833f766 |
|
BLAKE2b-256 | 321a9aef6f1c99a0c0189f4cbd0eff96d5d7511983e8c2e9af6cce61f66ac489 |
Hashes for bitcoin_explorer-1.0.4-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acf82b42c34700e04cd0b62378dc5581e041ac244fd6d933cf1eb74da17fd662 |
|
MD5 | 71fcab198ff8302a9ce114ace4b8f9b6 |
|
BLAKE2b-256 | 11e922682defbcb154bde26a85b933082df3eb10436c0f4c55b845b96d5766d3 |
Hashes for bitcoin_explorer-1.0.4-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52400f777639caecd877a2ed4948748735111da0bbaab3a6fd235dd4c1c1310f |
|
MD5 | cba84426ac76b74c7a02f21066a125ee |
|
BLAKE2b-256 | b35e8f34eb990ad385260668e760af69db697d85723d25fb05a2376868e42171 |
Hashes for bitcoin_explorer-1.0.4-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1192de797d2ace82a9e848e5fb9e691e9b5b316859d49716109354209214e63c |
|
MD5 | 85d6f428166d9a7f5d883af5f655c0c2 |
|
BLAKE2b-256 | 75259b1f902bc32ce5054366cd23fa9e32d14279a47e21fd30f177af21ff76c1 |
Hashes for bitcoin_explorer-1.0.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 509103847eb0aa9a1a2ea95192d6c3a0a1192be9aaa41a1dd3e4a74885223d8c |
|
MD5 | 07f042fe84e8aa27a946d00ce9d3f2a8 |
|
BLAKE2b-256 | 55b417b65688e090bf53084abd5e1b5166bdd66a2a37ce5705adae218ae76c73 |
Hashes for bitcoin_explorer-1.0.4-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ce486b538e14d65033c4aad56e78d45953bb81bd998ecf27c5a6269d64d9fd8 |
|
MD5 | 35febbc4d255c026ca7029e53ba44304 |
|
BLAKE2b-256 | 7866ea0da0bbed9181811bdbef7aad08c31c515b3d68bf364f728b65fee2b00e |
Hashes for bitcoin_explorer-1.0.4-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20fdada73bbc7ee625820c9ce4b3d7e3e7b80c54e1e844e46cf7221583557121 |
|
MD5 | 6147ec1a49b84b99c9a28cafb02f3949 |
|
BLAKE2b-256 | b1e3ba719efa88800b90393e9fe2c16e426ed6e99b4e1630c821aa1cc4c0e644 |
Hashes for bitcoin_explorer-1.0.4-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ece032635054274d4eb1b31915f694e1b3a19d6c8af6f67a4c46bca3324a3b5 |
|
MD5 | 20254a2ea4dbc511527840a7bf203d2c |
|
BLAKE2b-256 | 64b6d481de3cff8684b3508494e48776d519315a4b61888d3b945be9304a459e |
Hashes for bitcoin_explorer-1.0.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b904b4fb6a4cdedf3d95b8efe0f7e64ab1a2d37775289dcab1afe0b6668699e7 |
|
MD5 | 43101a849e98b5c476f6ef6a41840ce4 |
|
BLAKE2b-256 | 1c7d3706ae83d814a434d0115d0d57c4603299bd36bb966a0e5ba28d4f1deb43 |
Hashes for bitcoin_explorer-1.0.4-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf611db59fcccc1434d0e43741726113b056fc4107fc16eaf34be7ed227f5a0 |
|
MD5 | c55d895d163e61a0caf562b55f8162c7 |
|
BLAKE2b-256 | 32fe413eecc0f7105347479598c53a1ac80aed8ee392105d39e480d8c8e4b864 |
Hashes for bitcoin_explorer-1.0.4-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 240421315a49014daefada21dda8c25cd061fa65005f7dd6534dfa4c8e13ed0d |
|
MD5 | da5116bb19cc4e529b545e58b67bdbfa |
|
BLAKE2b-256 | d53eb5d0fb6e48c7456c1f84764caafc533385dbb251525090ff627e3cf4ebe3 |
Hashes for bitcoin_explorer-1.0.4-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 693821b7e25ebd590b8e1bf6a7b911ffc2258c4414aaf7590c1fe1bd083a4b27 |
|
MD5 | 28e0bf3fdac011e8512438370e13f638 |
|
BLAKE2b-256 | 968c242752532841d40e2ba3f7d60834b965f83a9b691af255250ccee5de856d |
Hashes for bitcoin_explorer-1.0.4-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | defb403636353d56dd57765eb3a48ef66f9947f1effe354bea013e459deb06e2 |
|
MD5 | 0f2a9421e46d7d88059afec049c5a331 |
|
BLAKE2b-256 | b2bde4700bcbe39c368b47a8d653de5ac6e520f9d18aaa6e3ae6088151fe2366 |
Hashes for bitcoin_explorer-1.0.4-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cc70b13188a7563ea99f5044ef4a89d769d2c0d8ca42d1443164f3ad2904c8f |
|
MD5 | 205afb75467a31b5657e9011e1490dca |
|
BLAKE2b-256 | 004a6403c425dc0ac8202be25a9d9e5e39520fa2c9ba56506712db240a616af6 |