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
# This requires 5 GB memory.
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.2.9-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28fbf852d142eff8fad75e0a7e0d93082caa572d4fc366e7999c7966916529bf |
|
MD5 | 1d4b171209b651b1dd71768c7d75a275 |
|
BLAKE2b-256 | 322ff983906657ed8b14e4d9b86230ec5cda8001d2e32c9931ed77a8b1a70662 |
Hashes for bitcoin_explorer-1.2.9-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0af6cb3d2b19111d17b147fc13ca5c165256d0d756b809053b782fc0bbc429d0 |
|
MD5 | b5ad18250843526f9c9c5b07040e2764 |
|
BLAKE2b-256 | e24d0f627b4022d6b67f0d84a087f3ecd3b3d18b9026c80b42aea353043d3937 |
Hashes for bitcoin_explorer-1.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec692ec48698889d9c51a3c82d96383a39aca947a38c15867871a424fb687f89 |
|
MD5 | 9ebb2b02b7925493ec6f819fd8229524 |
|
BLAKE2b-256 | 9341dbdb2fc2632823d6aa78b8ec0c7006d9d16cf450c1f6f4ca1d3e4655d3ef |
Hashes for bitcoin_explorer-1.2.9-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd4667102eb913f0b07c7a3c09cc0b96b8bba7e89dd43e563683a4732805e0e3 |
|
MD5 | ea65e7759d3182fd0f58eda88a46315d |
|
BLAKE2b-256 | b0852beabd5a691e69cd6fbda66767f592c63ff578c7a3d03827ff833cde85d5 |
Hashes for bitcoin_explorer-1.2.9-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab6510982f734b858410757a58e45bc9faef4e1d0a7becff96a3e9b486c3a9b4 |
|
MD5 | f9a8b1ad51915cea2b442b8775b155d3 |
|
BLAKE2b-256 | 1f9338d1ac8744be9624bef1384e72fe2f106d84cb87725004ff647422074dd1 |
Hashes for bitcoin_explorer-1.2.9-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9435d0da5c881a8e65f1c6b8044e58be5d70106b283f5e7fb5f481a279d4bc1 |
|
MD5 | d76c1fb7a3c14abeb86d0c5896b68b97 |
|
BLAKE2b-256 | 88bc23c7a55e2adb87e28655df8b2ae67fe6359e18dd5801efd9cb79fcc2d3f8 |
Hashes for bitcoin_explorer-1.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d73797e718d76e2cb67a939ebe6fc9e84587a3d1f414a6ee2fddf52ccbf2d50 |
|
MD5 | 5d1c07ea6e63f1644d074b8f23e5b100 |
|
BLAKE2b-256 | a85f3ee058ac81cb53c5df5223222bc86b6a507d061fd3d6817f08be8c322ae3 |
Hashes for bitcoin_explorer-1.2.9-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c792fdd521cae87f88fc54ebf4dac051351b45fd74a36453ca2c405af56abbbc |
|
MD5 | 7e7ace72cf11e35016f6b6a4f3fe2c60 |
|
BLAKE2b-256 | 18049e231715afa0f803fc1937dc87d5024aaaacf7c723176a04e14721f0e85b |
Hashes for bitcoin_explorer-1.2.9-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9370955f69e73d8aed66f07682471679badd07e6c32349e9f7915feb1dc6aab4 |
|
MD5 | 07a0742d467dfbd793fe5b4d9b25aae7 |
|
BLAKE2b-256 | 609bce2d60c3cb05e50ecd79844f8db34da3075a90a2893996071501d161ac48 |
Hashes for bitcoin_explorer-1.2.9-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d08f9ee1a6219c3b9d915055f8d227f7331bfda3bed672688ed9accc6363442a |
|
MD5 | f32c780abbc02de100bd37d48d70accb |
|
BLAKE2b-256 | 25e22ee52e0740b4007bada4f62ec1ec34d015131d31ffe158e3082ce0470f42 |
Hashes for bitcoin_explorer-1.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aacb52c8236580da2069cc35e15d5523c438a1dfe0a08d3232377cff80edfb7e |
|
MD5 | b7571b7794093a013a8ee8e3cc684031 |
|
BLAKE2b-256 | ff4be67e0a4af117a13074d438d71953525c33fbfbfc55d51c823020d6aced91 |
Hashes for bitcoin_explorer-1.2.9-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7aa1990be529b4ed8d77fd78c7f542e9866d0620dfac8bbd68b8ba7975a8e99 |
|
MD5 | f83c9f5f8117f3dcd8d23eed4ba289ff |
|
BLAKE2b-256 | 185a065675a5655b59712443376d8eea03f7c0765763fc92786544a001be7ad0 |
Hashes for bitcoin_explorer-1.2.9-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6bfdaba888a7234444e02931b2b5c3c1e273e66ec664e6fac62bc7a04773e0e |
|
MD5 | 79e549f5aa688f554bd7aa99b7b75a8c |
|
BLAKE2b-256 | 9b98ea24363467090328252a38ed4a7e0f05dcbb92347f2f71f913c43f637de3 |
Hashes for bitcoin_explorer-1.2.9-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ff947a694ec045f2a4dc0c0b0b1d758610501dad3b79f187133f7e9471d0fd |
|
MD5 | 25ab77c427b970c5629ecc015eee3bcb |
|
BLAKE2b-256 | 465d9c07931cee0f96254e6e5f3402aefaa80c24cd3bf20e24799487c61a2864 |
Hashes for bitcoin_explorer-1.2.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7e9f24fb3b55cb86525b8ac72c3ad5252a14fc936624bc6edb1ea7ab5ece752 |
|
MD5 | 94b4644795d55d4777798795fbca0f09 |
|
BLAKE2b-256 | 4080ec85d1537da7950c5218e8b1b49467115b4c715727be33f9fa50bfb494b0 |
Hashes for bitcoin_explorer-1.2.9-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8858245bf87e7719e6b5d662dbc96971db989313850a2df8d2a4f5fa3c582949 |
|
MD5 | 3ab919ab175d26fa3b638df3f10d0ab6 |
|
BLAKE2b-256 | 83e1bea4f7101a48f157af06456b24b922de1dd727f7e3ea88596a3467055b8e |
Hashes for bitcoin_explorer-1.2.9-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93c0249ca111fcc5be6a976d95c35e1eae0f17e34ea827916199dc26ea25aa7f |
|
MD5 | e0834ceb8c8002655f18484985f9917e |
|
BLAKE2b-256 | a1ef65642e4345b2d0604df903ed44c167e6be46ee13793bbc98d254ef501f65 |
Hashes for bitcoin_explorer-1.2.9-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3119555378d00e9506bc74950e0fa2b2926c4c6fbea9ba00f234e73abd815e5 |
|
MD5 | 8f213c22566a50d0c342e13245a03578 |
|
BLAKE2b-256 | a98c51fe7e4537e0fbe18cb416cb0147348a54886fb84d8c30a729a8126e7e99 |
Hashes for bitcoin_explorer-1.2.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6ca43b2978609914bd3e76f5ceec9bb4d9591225296fc586a79fb07144792ae |
|
MD5 | 82b560312584f7a910e03b377d2312df |
|
BLAKE2b-256 | 5540eeadb950aff3ff71ea74d9164ff9db8f1b5b93771afd4b8d9e8cb46dbe14 |
Hashes for bitcoin_explorer-1.2.9-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7193c4c8a51010c41fcc7ba832126663bc9b70f69fd99bc81f34988fa6143096 |
|
MD5 | 4d50810912c9c8e3e053163e5970a1c1 |
|
BLAKE2b-256 | 8bff52c688d3036db4643a30543fb7e1b9617b80e154d5f8dd86816d61bce18a |