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.5-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3589a0f26c675938b14ec5f102ac1f2b929b714faf2fc167a2ce4a2a3ab8a85f |
|
MD5 | 8cc090ada01241dc2a2deb11683c083b |
|
BLAKE2b-256 | e3a188d5d822947e985a5dc46f66956a982808cb35a907e6a42c755d2671521b |
Hashes for bitcoin_explorer-1.0.5-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 081ed392540a6f8a00dc287c0301f40e4bdf91dff1b78c7d18c92ce6d8adc617 |
|
MD5 | 0e53b18d0eacae497466c68648d6fe98 |
|
BLAKE2b-256 | b36928a367a95ed0a7f55fa69d7eb0f8cf8746af5a80671c46067a82c454be81 |
Hashes for bitcoin_explorer-1.0.5-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e421f6300bda111e9966301252ab2146c59fbad4c9f2ec38fdbad9849b9ffac5 |
|
MD5 | 7c878e43f6499f4b3e75fa2b9bf5590f |
|
BLAKE2b-256 | 1c4d7bad10b0697be89198bb46aacc9470712a48225e0fcc1688fc86d24fa2ee |
Hashes for bitcoin_explorer-1.0.5-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8089fdc1e1ad48b8b1208dd4da3261db206b89e2347f086a05779101b83261a7 |
|
MD5 | 2872715c76710ece4704c9a44d036e9d |
|
BLAKE2b-256 | a97282d0c877bb32aa17d38b5e2d0a10f00c8723428e7b260fe1833ffe7318dc |
Hashes for bitcoin_explorer-1.0.5-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42c85a20fee464b585d2fd6ec9df02264310a8d12fc0cd24de57c838c0e7d5d3 |
|
MD5 | 6d2c5ae15eabaf54815de6836747716c |
|
BLAKE2b-256 | ad70ae8587791436b99530aad42fde11814069865e8e0ed576df6e3ba7ae493c |
Hashes for bitcoin_explorer-1.0.5-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddcc93f33232faeb6873ad067cb9d3a516c93f5e3b343711367cbedf2a7734dc |
|
MD5 | 06656f88525abff9755ed58561158934 |
|
BLAKE2b-256 | cc069e94bc3fa14367f8f3ec0fe417d728f46e7b7569ff668eadb114c6298b6f |
Hashes for bitcoin_explorer-1.0.5-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 453fb9a837e9a8d5c6eda43dff4054335173fe329a4ad449cce3e86e33054ddf |
|
MD5 | 069073f0bfca592ebe38a23a5739a372 |
|
BLAKE2b-256 | 3dbb66f823d7ffb8368059d71fb58a12af854d8028463f64b9597cbd935e73ce |
Hashes for bitcoin_explorer-1.0.5-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8dcdf3ca728bd0664bb3c4d311459a8bd8c5debdcea3e80ee3dac08ebbad312 |
|
MD5 | b23205e566a9810e50b867d84832b63a |
|
BLAKE2b-256 | f8eb42a6da738d3237c99b2923b0d0b2f8b4ec8007d56823e0c44670e031016c |
Hashes for bitcoin_explorer-1.0.5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f3a2ad5f4576ef72ce68cfc64695ddfb18ca46e5914c6dcbc7dc6fa5322f72 |
|
MD5 | 4d86ec19765731bc8b7e025a94399f12 |
|
BLAKE2b-256 | 2b0864268f3c7a7c8d363b3c790da676ef7fbecd7141dd8232c4bb5671df1d01 |
Hashes for bitcoin_explorer-1.0.5-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60dfb0014fa72b05340bd3c8230b8e7074d5d61f519291dfbfbbaceb034380b4 |
|
MD5 | f1fa571a9a8a760cb86b42228aca295f |
|
BLAKE2b-256 | 03f19a835f235bafd3f47eaed63daee44908d1d3aa1dd9acddce9a339db617ae |
Hashes for bitcoin_explorer-1.0.5-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a71a817ee07312327e88b039df92dc02a49609105fee9ee0759c38f6e7a3f437 |
|
MD5 | a5d51b1bb69505a56a3439fd802d1c80 |
|
BLAKE2b-256 | e509305e557345c221eba9c89a8f088637667d555bf06290498c8bc30b43a7d0 |
Hashes for bitcoin_explorer-1.0.5-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93f759c763a3fffb13f56575b15a6eb497f9d81b2bd37e96acc0496665a60927 |
|
MD5 | 8932f4db79ea1e8c02de7ace47144a92 |
|
BLAKE2b-256 | 72336081c6171bba86292430ed6978345ceb36affa36b467e8537e214da177b7 |
Hashes for bitcoin_explorer-1.0.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 575bccf70fc5296841de8a65c57ce626100a6abd9fe31f7b2ba990cbc63112e8 |
|
MD5 | 2c7f72f11c2f45f62a0ac6eef634c10d |
|
BLAKE2b-256 | b741e3099167dc3a84eaf9c8844e36f51163c2eaeb727a0a558063fe62300946 |
Hashes for bitcoin_explorer-1.0.5-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc4e32a447a2d4b313e0a736719bc8ed3f94480cea9cae0f3c882605022367a4 |
|
MD5 | e2c622e1f2eb67693d4bfeb2d175ea48 |
|
BLAKE2b-256 | 4ae662dc48ed33b7cd1109adbc457e02a8a9adfca09e0b502c9c0657e26fa2cc |
Hashes for bitcoin_explorer-1.0.5-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15762d3db18167f2aeab4112d1160eced027d841f9214a7c971f2b47076afd07 |
|
MD5 | 0f9ee28ebc5ec1f583240d119cb2ba4c |
|
BLAKE2b-256 | 8858c1882e6f4a0f1142498ba0a21a10a6ae34fd2359a5ab72c767336cc4cec8 |
Hashes for bitcoin_explorer-1.0.5-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ce28a2d35b02968f9fbbca2dd1ebca801c4a462aab628f34ffdcf5794fa39d4 |
|
MD5 | 27b410327dbb9319996103ed8b5bddd2 |
|
BLAKE2b-256 | 6ffee722265764ce48aee379b62ddf9dc67641ea27bd0d6bb44be0e245711618 |
Hashes for bitcoin_explorer-1.0.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7fe7c80fe5d33793c555ca73a5204447b152f5b62c194af177bdeb798faa495 |
|
MD5 | 27fa3dc8da458df42339c10f9dd57145 |
|
BLAKE2b-256 | 2bae1223077a8c01f02c757f79bbe7e005df29e33a57e3c91643a32546d58d6a |
Hashes for bitcoin_explorer-1.0.5-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acb486b778717833cae4614c134af9f8375c2257c2d80b0fc9e2905c0afe1abf |
|
MD5 | a9d08c2d193b0d4d0c728050cb1d96cc |
|
BLAKE2b-256 | 7afdde807e2327405437bb5da197d17452388c9b820c86cdc713bf992e5ba766 |
Hashes for bitcoin_explorer-1.0.5-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1554e3398da380eb70de6a5b0b12e2e76d5b92ad55618098bcd617433eadb7ab |
|
MD5 | c0d22bda310935d1e76e59fa6659c1a4 |
|
BLAKE2b-256 | 625138e530c65f5e0a3e77dac17ea15a535415bea801db2b1f5cad66eb2c035a |
Hashes for bitcoin_explorer-1.0.5-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d68c4bfefc06f3a86fa694b3357cb7ad8f550250f48c7d86dfcf3ef2132fe593 |
|
MD5 | fedf063e4687cf928419f8b71af7e6da |
|
BLAKE2b-256 | 3cd29a25613be86ce6c2694c2d6d4f48ade7757b56e746a006c4f68b2b01409a |
Hashes for bitcoin_explorer-1.0.5-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e14cd99b745a85e9fc7f5299c5ad9ffda9066bf7eb32f4c2f6668626fbc5841 |
|
MD5 | 0b99b75381c3a5d150e1728f5a828996 |
|
BLAKE2b-256 | 26e2a5236d57bb86901147b68e02eeaf39683c1980ecc45ed2ddcc488f73db75 |
Hashes for bitcoin_explorer-1.0.5-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7d771715c90c44c4d4b3cf220ab288fc59b3983cf38ddd041ef59d6375512b |
|
MD5 | b47d96d4147f95fe2de4d92943af1f34 |
|
BLAKE2b-256 | 5e5b05f6007dc6a8eef7097612cec7a23197a8f54b44be6d2f64ef1eaf91ed2f |