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 a minimal amount of 32GB 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.1.3-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b87673cf92322829b4a1dc5fa6daf4bab62ed651b824ff4462f8c4c80fa94b6 |
|
MD5 | 3045ceed598a60643c48b1f177bf9171 |
|
BLAKE2b-256 | b342deafe2e3c6154569fe6af4c5dc070a0f9a6157b61c11cfa7b1aee1c9ee07 |
Hashes for bitcoin_explorer-1.1.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30e4e2e2200c27829244340c9563d58a04d170fff0a496f018500dae6d26043 |
|
MD5 | 9963a42d490bde345f89e8cc255600e7 |
|
BLAKE2b-256 | d17e881f0f91d9e71681c64a343a1e0999272bdbb7e69dd1267a2eed97d86e5c |
Hashes for bitcoin_explorer-1.1.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa5a855183b3a902ccbc1817647ab09d65585362f2552ebb8583fcf377559b45 |
|
MD5 | bac79276654dfcdab03a130dacd02ecd |
|
BLAKE2b-256 | d21e7a8e8b299814b2db728fb51f9fbc42d1e209bab678b9aa8d8b3717d29ec2 |
Hashes for bitcoin_explorer-1.1.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e99f748fd19b8f819dbc9f0fc6ae4939846664baf61c660b906fab1510d3754a |
|
MD5 | 03041fa2283f0721a28a227eee7ab269 |
|
BLAKE2b-256 | ff18f152dbb08a8bbce01c29e4508d8eaa4b7d9fa5cbcfc5aa203309fd3b80d9 |
Hashes for bitcoin_explorer-1.1.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfa67d97fc2e06d4374a0f1ed4c5b74c9184dd3bbef694c59295c7eb094f30ac |
|
MD5 | fb3797077f7d212e96b120b5c256d7a8 |
|
BLAKE2b-256 | d769032589bb27dc1d2c08cf3ebb9cc94b485b0e21dd3c2f63307d199def18ee |
Hashes for bitcoin_explorer-1.1.3-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b2338c028d9ed7e99b46a94aa1194f9f8deddebf74fbb1b5e0e112513d62719 |
|
MD5 | b74202e859020128e0b5ac452a625bd2 |
|
BLAKE2b-256 | eaa4ec480eed7b33c543fbce2bbaf40d502180361896b8306abe51e772775622 |
Hashes for bitcoin_explorer-1.1.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20bd18269d67a35c4e1ba66d52acc633d276b4c36ce180a2573b557cfe7daf8a |
|
MD5 | 4afff9d717c569d83aeb7f6ad0fd2f1c |
|
BLAKE2b-256 | e6d125ea669e229e9c01ff41729e2f2d24e30cd2173143ec1b2408f6ab4bb58b |
Hashes for bitcoin_explorer-1.1.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e48c40c2972959d26a748020f6dd4e6307f6f9449516eb2ccb2b3eadd51052e |
|
MD5 | 24f35288c38538f689adf7e2c85bd26d |
|
BLAKE2b-256 | 0c6b2d52776626bd34208319b7f34a2374391a30b89999fd5eb3478ff26516a5 |
Hashes for bitcoin_explorer-1.1.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b42cc304955bae6ba098a35fd9664d2bbe236b54d3ac070fa0f25e1111800301 |
|
MD5 | dfd250ddd059ef48ba08c372030157d6 |
|
BLAKE2b-256 | 135b28c65712ba923fc8dfa0eca3c18cb7c0f626b08af478305081178a0e4615 |
Hashes for bitcoin_explorer-1.1.3-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f4535ae5aba7f8c3eb8e0087725049a1e9be6760d0c7b2933ab0623676d127 |
|
MD5 | e23ae7dbdcc532c77202d59479050fe9 |
|
BLAKE2b-256 | f047585e8b078022a32998effb35e931ef08c0f4c8840067057073238d00c83f |
Hashes for bitcoin_explorer-1.1.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fbc949ef68c9e0f951e108c80f53ac3901aff1e7cf31c3c58354416d6b46944 |
|
MD5 | 8f2f1b8c8fc3e63ffd7b3b17e9ce5fa3 |
|
BLAKE2b-256 | bbe0e1c4446889f208606d92344f0a06393f6c7aa590ab864611525f12af273a |
Hashes for bitcoin_explorer-1.1.3-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d17be85310150323ff2f4202d67949b0a09bedfcdd83a2ca298b7e869314e37b |
|
MD5 | 3c99086337a87a31ff17ca57e1790820 |
|
BLAKE2b-256 | 168dffe151eb3c14bfcee92b800ac825068934e32a750c856b90aa41f7d68439 |
Hashes for bitcoin_explorer-1.1.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e4c48bafb121f05080421abeda3de6eb1777c2da09635cccb294a71f6d3267a |
|
MD5 | d5f52b1a6603b49813789b1c8ceb2548 |
|
BLAKE2b-256 | a6158f84722fbe596b974cf413c59dcea97e0c9ae79ce10723e9a4823ee3a7c1 |
Hashes for bitcoin_explorer-1.1.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73bbd55277774cb71b6a1a909aafe3e2860fb6b94ff32407e75f320b8c3a0776 |
|
MD5 | 6fd2da6090237dd2027dc613aea76a18 |
|
BLAKE2b-256 | c46019338e6455506f694f314ce50af8b40c8c0ab0d51a8e73fa1f388c6859e3 |
Hashes for bitcoin_explorer-1.1.3-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20a5b26862cb08c54126b29ed34af974e43a572a11bf6c987ad9387bfcc3c66f |
|
MD5 | 43071c5fe537df843ce8a782faa85a52 |
|
BLAKE2b-256 | 70237889caa7f3c048f211c51c751222a6007d1eee860eef2d633e3737661c09 |
Hashes for bitcoin_explorer-1.1.3-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ed6ee3e5029b9b43036593d28400f1f03f6f3491b2b7d8c86cc6a7d4f6decc2 |
|
MD5 | ccb7d37ffc303775e710c6df6ff1b396 |
|
BLAKE2b-256 | 13b4aa35960a867e19e26c215c1b20975b91ef401a728d6ef51e770b06234ae4 |
Hashes for bitcoin_explorer-1.1.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28a1e39f1539cabdedda6839897576da7195744d2c2977d1c77721b951d5f8fa |
|
MD5 | 5b127c27a44658c5bc25b8b2e44caced |
|
BLAKE2b-256 | 6e3bc29f61a88d79054db33e51dc3cb5a5ec5377f9d9c1115b4218002591081a |
Hashes for bitcoin_explorer-1.1.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea4a511400de33d7238fd326db2fe01a8a4ba3a8651e059ebec66b63ed25ecd8 |
|
MD5 | 7fb1401d4c97595b0907455c67d9e2a1 |
|
BLAKE2b-256 | c5b6d1e507cb66534c9aca8cdcb468a432b364cf04aeb8c5405edaa067a6ea3a |
Hashes for bitcoin_explorer-1.1.3-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ab08a5aea30c72abf59919eb583d03775d4f811636b0dedfa8cb80a40a67727 |
|
MD5 | 556572bd40068b613cf2006f535ad4c9 |
|
BLAKE2b-256 | 6168830cf8f610ac21381792afc2a5394ad78f5ad6515a2fa62d94cd6334577b |
Hashes for bitcoin_explorer-1.1.3-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2842a17a81373df2b622eed6ee4063e08b9a42b061d52946fc4f4d47c65dbeda |
|
MD5 | 98dca6118fda7fcd7c858441ff460724 |
|
BLAKE2b-256 | 9b10d57aa405f55fa13a80ab5e754a9bb9dec161dc7cef74a8425bac3169fdbc |
Hashes for bitcoin_explorer-1.1.3-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5aca06df164a3bfe9b6a780d97e1d5688aa6fb7a691a231a6d651bd623dacd |
|
MD5 | 3cdcb090bc11d8a8ca9bf7b4f579b0ee |
|
BLAKE2b-256 | 078eee9caa39bf37ab3710e513d5cc558aaf80bf437d69a89fba2e4abab4c20f |
Hashes for bitcoin_explorer-1.1.3-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61b75c987521c32105184af44fc8f7409b03f8ff19e1c7d71e6c0f8ed344ad23 |
|
MD5 | 2c1eea76f508bcfc97a8f6a8f4d5a659 |
|
BLAKE2b-256 | 7962182a9361933670f07ba971f7ab7e33b08e15ba6140495d3cde32693579b3 |