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.9-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad3adee055a728c2dc9b0f222fbf2cc9b3ffc2e09052a8210215a6444745e615 |
|
MD5 | 75e2556a12036a05634c498e66caa82e |
|
BLAKE2b-256 | cc7baf997b5b58a6673ea0ef7ecbefe29bde899e44f6149736c8c9304c33411b |
Hashes for bitcoin_explorer-1.0.9-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57aa8763bffe008e896221d7739450f2d1e5f8f648da61b06a9f4be8f7055c01 |
|
MD5 | c22f39338bc6f9c9ca1f5ccf5200601a |
|
BLAKE2b-256 | c08c1c4e0b09ba1951ffdebe82eac0ac9949eb835ae494418ce56e804cac4fec |
Hashes for bitcoin_explorer-1.0.9-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e35436238177e6c1e6b3f8c627f8738b3941c3479ed771f53f6dad10a8945b4 |
|
MD5 | 3c53b0e7a85d01a700b6b8dd0f44298c |
|
BLAKE2b-256 | 3ad42146855cd5d1401971123fee32cd853e4297b1f48fafa34e54632ed28ad9 |
Hashes for bitcoin_explorer-1.0.9-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9451d56e4f2cea86cae544d9f521128915290c1ab1768b2eab01e634ed385e7a |
|
MD5 | 0e15bccc542fe20163bdf59f55952c5a |
|
BLAKE2b-256 | 89741a5f1a6b907ec88fb6ebdbde2e448daf931be67e028312a746104d5be7f5 |
Hashes for bitcoin_explorer-1.0.9-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6266adc152833e25ebdb8fdac9c2d6564e42c21685f40214b936da688142e65 |
|
MD5 | e93c808810e14098ff490333d6e17c62 |
|
BLAKE2b-256 | c20f33cd212d28d8a6517bdf0102fea06e0f89715b5fc9980d03a9d824060dd4 |
Hashes for bitcoin_explorer-1.0.9-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbd81c133e1e0455748119f82117a3a67dca1f70e554912a817b902cba23214c |
|
MD5 | 5a72bed3611660bd51bf1da235b20a51 |
|
BLAKE2b-256 | 52115e0daf27cf9df2b434bca8f911b469fa8cde626184e916019c92afc3c9dd |
Hashes for bitcoin_explorer-1.0.9-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be7531e658bcb53db1a12400248b720f4d13b71e42e0bb4c14b51d1502a0fc73 |
|
MD5 | f07420560b62d66af06db06e49151fd0 |
|
BLAKE2b-256 | 7c8dd15756054af898349458eb8be76c126ef2f0cbab33efc2c8d586651588fa |
Hashes for bitcoin_explorer-1.0.9-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b372fff91c122930b17e21b35281eb02ade1fc84843d4366b4be034ce8412b |
|
MD5 | 73855461e291678e2df44347e59cf94d |
|
BLAKE2b-256 | 4a4d92caf4ca972e8c219f1c604e4b32b22ab4eba70d8a845a3b73677bd0e45c |
Hashes for bitcoin_explorer-1.0.9-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff0af659de52afb9156a4bb838807ac5c02b549ffd427a335ccd85cf75ad9ff9 |
|
MD5 | 9b74727b142c7534d727036346a00ee4 |
|
BLAKE2b-256 | 8287703bb9efa8f33587e84a5c842d6971992f5b0005ef42d844ea385e69291e |
Hashes for bitcoin_explorer-1.0.9-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b5e0034425f400b70e0658498be041ac5f85382db92e464136cf52984d76c7d |
|
MD5 | 986c8acac7dd7b4654f5571bbd3282fb |
|
BLAKE2b-256 | 55645f8162a34ae41b69897ab460888d82419caaf5c2aa24e38bc16b32303745 |
Hashes for bitcoin_explorer-1.0.9-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dff9c786de547fc885d2adac7bbacb2efdb025a05b8971c6309b4c195b654732 |
|
MD5 | 2b8af1db2fb8dd33cb90ce7a7c576b0a |
|
BLAKE2b-256 | 64c981bce3b17da5f71f8887aa14fdf3b2726e0cc0964bb1f207c237751bcc20 |
Hashes for bitcoin_explorer-1.0.9-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e6c896eb0138e4b4bc535bd38532b127b9f492ad3bde301697b49763ae5d6c |
|
MD5 | ea5b07dda9e30d9b68b35472599372b2 |
|
BLAKE2b-256 | 77c30acc3ec41b139090caa958f6b3548a6a8fafb67c4b7b376f03b0cd6b1212 |
Hashes for bitcoin_explorer-1.0.9-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cfe85b5e08bbeb1f5dcdf72394f39e0c325b8544d33fb04179af8675e4496f2 |
|
MD5 | 43b973fa96161859f2c70f376b4614f1 |
|
BLAKE2b-256 | 8238a2fb67539ef117e7a61330eb2a84d9f7624807c3bca13b93c76881c9cf89 |
Hashes for bitcoin_explorer-1.0.9-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa90e19cbef349df4fac80fbdf2f4048ccc1be490f14d46e50ccd65da8bce47e |
|
MD5 | fb913c4db84b602e272411c9b1f4bd94 |
|
BLAKE2b-256 | 165b029dde0b4982a77e32a6ac6e08e52b6ba1b12c16291c1e3739c837bd7482 |
Hashes for bitcoin_explorer-1.0.9-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1146a167f344d53384162414ace8adbde638195d315328461b9ceb3602d812c |
|
MD5 | 9c36b123da93d3b78acb8bb8f4bb1e8e |
|
BLAKE2b-256 | aae28166b32ad1e693c0837f56d4b9d0f19ab882c9e326e1b0fbba5891a121fb |
Hashes for bitcoin_explorer-1.0.9-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe8373273f3fbb29bdca665b3e651046ae5057e4d9b7852d38b2bdaca231cf1 |
|
MD5 | d686b519b7909c93f8f2527cb344da47 |
|
BLAKE2b-256 | fb04d480e97fd617228c9c7edcdf8e85d9519f8a501ede392e1b7e1cc4414dd0 |
Hashes for bitcoin_explorer-1.0.9-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82e0146ddb4fc684b701fded9e50a2fd1915fc50d9045e671c4be36e8f3c8ba6 |
|
MD5 | 3316195a20c71ae22a2c0b79b06212a9 |
|
BLAKE2b-256 | a8d576170f1af07cfa217b8574464b0f0d6fadefa8b8a550cb20f8c77b2dc710 |
Hashes for bitcoin_explorer-1.0.9-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb0ccce66fb7f6d42ecf6fd7fe0f1f75e9e06b5a6c3ecd39cd65a2071d3d9cd3 |
|
MD5 | 848f7fae82fdfcf17dcd8d588f63bff0 |
|
BLAKE2b-256 | 2667e3bd2ba860481c580077dd7ff42c5c3cfe948d875ce6b4132b39865740ef |
Hashes for bitcoin_explorer-1.0.9-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3af7826a2aaf243db755af2f0faaed706e2cb48cdbf1661b2588f19fb96a662d |
|
MD5 | cb24663c0bdae06aa7f52e3a76ae6bb6 |
|
BLAKE2b-256 | be2f3dc58c0a4edbc0a97a9ae3f6eb20cada4b1e916a4735106a2d601b7bd668 |
Hashes for bitcoin_explorer-1.0.9-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 470c9ec7396f2ae0153e4f0509e8b0789467e1a9183e23c1aadbfba0e33a47e3 |
|
MD5 | 6459dafccb545b729c883d8c75714374 |
|
BLAKE2b-256 | ad9598c0b78962128f631b1e71c45aba8bbc8f987a93a24f376b42e98d66de6c |
Hashes for bitcoin_explorer-1.0.9-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78091882b15eff50e0fdefb333462229aae908ca0a5f1063356d651451af4d67 |
|
MD5 | 0b82270684be8994f8f421c41951af0f |
|
BLAKE2b-256 | e8d5af9c79f06b6094ebd116bfca8b4e234ff6c173c1383cc76cc33832730792 |
Hashes for bitcoin_explorer-1.0.9-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9015f456f2b41be67c140d2b0bc8e8c7da956eeaaaf4aa5d62e12da42992884b |
|
MD5 | 2db70d3f2abb2f00bc76272f6f9fa29f |
|
BLAKE2b-256 | 622481915649923ccb9a6022e7348d65b07c710d755a91349da9816de8c8cef4 |