High Performance Blockchain Deserializer
Reason this release was yanked:
py36 compatiblity issue
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.8-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3efe81b12d6bf4b399e074f68cc006f904d8b891fb03aaa5f5d45d7df2f31d85 |
|
MD5 | 15419ad99121c03fd037a8a96d4e7e14 |
|
BLAKE2b-256 | 01a58c20750c1cd764e59457fc9d160e8f8d928a61d96d2879d09cea116645de |
Hashes for bitcoin_explorer-1.2.8-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22e15cbeec19d0cfd5b7d5285ba36fd493afe1c9e8e060da279268a4787977e4 |
|
MD5 | 374b148f198d5bef1ae54582931cc054 |
|
BLAKE2b-256 | 53267dd16d3455039ef16af141a9ee1b533cbec80c56ff094226a299e0ac28c1 |
Hashes for bitcoin_explorer-1.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a3a1767868e4018bae3f6aa1616afb4dda3f20691d3045dda9c7ef1c104a9de |
|
MD5 | 7b92a74fbc4e5c4110d14c6905d510e2 |
|
BLAKE2b-256 | 70df0138769a9806519350066f4df9e57625349d1e931bed0d771bb7dee77bbf |
Hashes for bitcoin_explorer-1.2.8-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 230fd6371bd062f1d2121c50fa192bfdf5f5695304154450ce97fecbbc581b8f |
|
MD5 | d236966305aee7ca647440111ff3c9ea |
|
BLAKE2b-256 | 865a987f137f35a9ccc009723a3b41bd7f43e854e1e4db65ab9dd39177044f45 |
Hashes for bitcoin_explorer-1.2.8-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39c01a86f547599339fe4609a904bf65743a4da95ce0ed78be2c174d9549a006 |
|
MD5 | 7783e02716d78ba501938bc3e58db819 |
|
BLAKE2b-256 | 318a46a9b2fe9d98c7279d962009da6bba27ff86306aaca40432465ff9288fb9 |
Hashes for bitcoin_explorer-1.2.8-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a21e95c89f146f3f05c804a392f084b20d2fce931727cc4d6075fa727931353a |
|
MD5 | fcd0b0f0b1dc0219e3a577cfe68328ff |
|
BLAKE2b-256 | 09c974f637bb43be2ba762a2e9cad9980b8b64cb644004a6e1ee8573157388bb |
Hashes for bitcoin_explorer-1.2.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96251e5137e6f3c571d3c100748242e0e6e03164aad114445c3255ff3319325f |
|
MD5 | 0826f234ecd70cd124b4242590893ede |
|
BLAKE2b-256 | 9132cf49f23257063d65f5020270517bb7de98624965c5c94c9187e5a17e0d17 |
Hashes for bitcoin_explorer-1.2.8-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddc76c4717a1ea7c3bd344ff8f926bc95518e695faf997c693b3b5be734008ca |
|
MD5 | 7ce6355744ebcd6fcb0c0ac91c011185 |
|
BLAKE2b-256 | 529ed2ad858fc6f645adb16bf20ed419fc9792558b691cdcdccdfc2896395b55 |
Hashes for bitcoin_explorer-1.2.8-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0faf9bbc74c1a763f82dc82ede2bb93385749b0b8e0425157107835b0bc0ec8 |
|
MD5 | 40dc042309a8bf378944c01951eef999 |
|
BLAKE2b-256 | 452f4988f751ad35f458af1d06b21d72575b17b77d1c415b0ac19e96cc9721bc |
Hashes for bitcoin_explorer-1.2.8-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccd49e5c1cd8827079b399344c32c977f0ee61974ef078ac4a0f4c7136f78033 |
|
MD5 | ee3b7a484b6cb74d8feb594baf261d6b |
|
BLAKE2b-256 | 57678e720973e78b8f1ebc9f7dbf7a36da3da859580e6d3fb2fbe77919a430d3 |
Hashes for bitcoin_explorer-1.2.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4f23c5608d7a5613df54eb25703e826918d74c25dcc8e29d05dab0648840c4 |
|
MD5 | 924dbc12717484eda4bb8cdc26ba19af |
|
BLAKE2b-256 | f42c39dfac3e16297e1425cb5219a61576329bd392e5dca891f339ec536614f8 |
Hashes for bitcoin_explorer-1.2.8-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a093bb0f72ca8785835d8d7cf883aeb8e32f2fc212ffeabc4150942eae462cf |
|
MD5 | 479065ef40060ebbd113884b93e5f06d |
|
BLAKE2b-256 | f35dd790342a10b1ceea36012b8ec679bc0bbd1c68f5b3b577bfc96976c6439b |
Hashes for bitcoin_explorer-1.2.8-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 226c0a7de3ddd8529eb5ae034958bd197659aaef52975e2e81adf4dccf77f24a |
|
MD5 | 9632e425dcf04a73131762cb4f92a037 |
|
BLAKE2b-256 | 8d6d79fb8444c7b3dfc0d3cc2a937976931ca1af08feb023c94f57f91a2166ff |
Hashes for bitcoin_explorer-1.2.8-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a363f50831d2b1a27f0cffcc02c118c2c298453f39e86bd6a208a7cd22987f |
|
MD5 | 25bd4c7fa9c6baad56089efd27fa7726 |
|
BLAKE2b-256 | 63d8c1d22f3bae4575cae9e27d4904ed4363f2d6eacf0eb2337a2b90d68ce156 |
Hashes for bitcoin_explorer-1.2.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 757b1ad778de618d73b0ec467f8aabe87d775a7421a2767f5cf4e3664e83c3eb |
|
MD5 | f58e0c2021bd3976f30f71a997e8b6e2 |
|
BLAKE2b-256 | b00450c587ed34f1b145a6514bbcd479c39baa08ded6d290f71a0d9f17d7c95b |
Hashes for bitcoin_explorer-1.2.8-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 975fc2cad111a4864800434a7a613fc74929d679fbae8dce9fe63daa0855e5d1 |
|
MD5 | 0f9afae851929b94150087668d0e1f6f |
|
BLAKE2b-256 | 73485afb3c0249feef4a1ecda7a7c6ad47709c332d2d92176930d57f63fdf064 |
Hashes for bitcoin_explorer-1.2.8-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af42526beb7b72e74cce5184acdf15f4671c56b900872d07f30eb2a41a5abad2 |
|
MD5 | 1b5b7b7639f7286145e8cb8a0b1ac5c7 |
|
BLAKE2b-256 | 16115398b6a16e28e4c12000d022f626ed611bbaf9d26f53f371cefa419c74ce |
Hashes for bitcoin_explorer-1.2.8-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fe8b4c19a972dcc3abbfbfd5e7800e3258e7e12389d3b23b1d2ca4816652d43 |
|
MD5 | 8933c2764920c159827cbca588c47915 |
|
BLAKE2b-256 | ea26c554628e683e807005f0e1ceaf496b3f94a879bb12d3adc79bd5939566a4 |
Hashes for bitcoin_explorer-1.2.8-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7ffb944ddc47e2119d776e47694b611622318adf1429c2a3c5353b38d78f1f |
|
MD5 | 89eaadb016ef9668f848e886213085ed |
|
BLAKE2b-256 | 653faee2c61ca42e1e6ec7447c3c99b893353c01ca573180ce803f7072739bd3 |
Hashes for bitcoin_explorer-1.2.8-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e34b6083d90130b7c5dacd224fe591d0134f6be2855de31ede074d1c981a99dc |
|
MD5 | 2d3f152a67c0e19bc2d841fa95348ad5 |
|
BLAKE2b-256 | 14363eeefb9c0172a2808b6f482333fc15c12bbcf3194cbd399f234204d27c81 |