High Performance Blockchain Deserializer
Reason this release was yanked:
py36 build iterator bug
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.7-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bf38655a4ac1e5d70f3d77ecdcfad4472e622822f64a0c3e6204e0391def6aa |
|
MD5 | 40d83cd7fb85f66843b2940f73ab7282 |
|
BLAKE2b-256 | 3215731c6d3c920976ea0feef90dd535149dfde1153995ca91e69fdd1f8ebe72 |
Hashes for bitcoin_explorer-1.2.7-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7427db247a64d6cdd0f97015aefa90dd1cea51d714524f9b3996fe1d2e0fa41 |
|
MD5 | 77b6b33c0d63e8e1cbc52e049ad4e535 |
|
BLAKE2b-256 | 13bf2de6a8c52fe7c658542461055ca57c7add3952bf709c30c93309cf3f3f75 |
Hashes for bitcoin_explorer-1.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36742d6501dc1a7b06ab5297e8d11cadf6909675e271af0fc651681aa480f208 |
|
MD5 | c7233b097f9f12bad4b9f804a5c1746a |
|
BLAKE2b-256 | bf80b740871c013f94492ddc415514d20ee30d3d55b7cc1c04e9a0e831f0dbf9 |
Hashes for bitcoin_explorer-1.2.7-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5884218f881f19893783754a50e89d4870a6126633c95f056c890b94a4cd0bb0 |
|
MD5 | 36196a2d67505b61237720e4cbc621b0 |
|
BLAKE2b-256 | eb4a46a4777c098fa230cff1e8081f25ce602780158eef6a7393adfc99055125 |
Hashes for bitcoin_explorer-1.2.7-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 313f926f5e0ba0a8d52ee8399bcc55d513c2c6c24d61407bcc641dbc24d982ef |
|
MD5 | 5f51621b2e82d48d5effbe9009dedd3f |
|
BLAKE2b-256 | e84170359a512ff1031f4be087cd86b7390fd7f0e789464c84e536c95b36e9e5 |
Hashes for bitcoin_explorer-1.2.7-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3e5addc8be32be665bb6c372483082b91e2fafdfc5969a41ecf7cd04d61fa83 |
|
MD5 | 62a8e8626addcebee4c8e6cbf6063b22 |
|
BLAKE2b-256 | 2a83487d7aaa85ec3725a346fab64d92df865db7b4d3c5b0511ce4c8f92af690 |
Hashes for bitcoin_explorer-1.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6eeb6d1f8891c0ae09223749450f77c4fff74679e0abc34301c995b6209a758 |
|
MD5 | e406e482ac0be887a36d31fce375d659 |
|
BLAKE2b-256 | 05de4a2798afb26925ea7e7fdeaedc87290293e2c2bcab200dd2ec019a043aab |
Hashes for bitcoin_explorer-1.2.7-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ed25163618d32438d17e069bd6955ac75d86000f9f5805f6c9d14298903befc |
|
MD5 | b5f9738ebb851c19ab51742b617d4d26 |
|
BLAKE2b-256 | e81755037e67f4fa6e7574551b7842d00eff83cc81c2d507971e9e66b721bab2 |
Hashes for bitcoin_explorer-1.2.7-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8ee48b4f7880cee1c5b3f373e9029069e65f6912e34bc1fcd694f0cd3e35721 |
|
MD5 | cd664943bfc1d169558d0c2316d5307a |
|
BLAKE2b-256 | a8afcbbf2807faae35b139b834617093b7562cf8b4e7abffcfe9ddc948aa508e |
Hashes for bitcoin_explorer-1.2.7-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb55a5d17f31ac318394ba3a5ba233af2b53a8fb7cb0ea525c0a17f10e14a8ed |
|
MD5 | 874bcc087d8426be80b56e064e762496 |
|
BLAKE2b-256 | e01e8542180e34639e6b0a055af94d4228c418209e89c5f488013057ca3d92a9 |
Hashes for bitcoin_explorer-1.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3630c6ef9ec425047cd4ca0824d9a18aa828739e1f8917d554857536dd65460a |
|
MD5 | 4dda7051e604520c06312ed89cd4601e |
|
BLAKE2b-256 | 0df1a851f3993670b5b34f4b148fcc18669e04776d2016a6fb4e2b8d23786a6e |
Hashes for bitcoin_explorer-1.2.7-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39cd31c4f91e4f61eef73ed91734aa299458f6146fb2fd96f8642044738c1278 |
|
MD5 | 4d696f55db9f788734f04c242923be8a |
|
BLAKE2b-256 | ef07cfea02003d1c27d52e858b581ef351832999128a633e5fa9067ad9d22add |
Hashes for bitcoin_explorer-1.2.7-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b138979f73141f850e4af861ef3ae9ab7d80031d4e960ac8ef34e1277ae94940 |
|
MD5 | 185e7b95fa78efa0d09b8926afe4805e |
|
BLAKE2b-256 | 02cce97d6efad777035dbcd48f058cc44aeaf6f4e799568f2452453628d2ce08 |
Hashes for bitcoin_explorer-1.2.7-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c7eaef22963060347d924116c4ef02d0e11b2aa71ffafeb30b929941cf33e34 |
|
MD5 | a8a76b77e8acafedf8105849c5598a64 |
|
BLAKE2b-256 | 1870cf37b6a04597053e6ef5ba68c4519fb06f93480dc85dab343b5d5ef59e38 |
Hashes for bitcoin_explorer-1.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7491b22888bde739f6521e00961d4555b8ceee32d28960bf4e179f0d1c7b461b |
|
MD5 | 9807d01dbd8d91e257bd9c1b4a6e2cb8 |
|
BLAKE2b-256 | e163db182c88c0726ae7cdb44ab03ad5f6c62e37bb26fdd3d0175e697a108ef6 |
Hashes for bitcoin_explorer-1.2.7-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 933e331d660f8c57ef88d36cabeed23170170ab2222bef72e0cfa9d624b5a51f |
|
MD5 | 60f866b5c59f7ac9c3c8964bc346546f |
|
BLAKE2b-256 | 095bf3db9efa446a9ecaed4909821dfb6c37fd5ccd30055fa626e3c296f40b64 |
Hashes for bitcoin_explorer-1.2.7-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f614c19fa77133c13e707022b69916dbfb0387e44ef4f88d288d5f49abd6db6 |
|
MD5 | ac388294cd26b803ada0315b2d1b305a |
|
BLAKE2b-256 | 3aff01cf5fb5156c91d7fc788ba19cb2689b0c85b70af560f5dcc046f4f9700c |
Hashes for bitcoin_explorer-1.2.7-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dd8841f24f223eb18e64bf730fc721ce4babe2894ee32011db4ed2c8d89914a |
|
MD5 | 32d2590cceffeccba5ee910515aac4ca |
|
BLAKE2b-256 | 3437010aa9f2a23b69d0dc27d1f5affcad365b07161138ba6a081b469995b532 |
Hashes for bitcoin_explorer-1.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ffec6100203edbe14b3c62b0c8d770048b49c074e38684ebcf963fa2e3c7bd |
|
MD5 | 0099cd4e4a8ac033dc89402d26358703 |
|
BLAKE2b-256 | b267d33696b2df65fb82ed42aa2a6cab6141a67498ac9e720ddc0386b49a4019 |
Hashes for bitcoin_explorer-1.2.7-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e2b38d1b191bd1a77aae3ac2f1d1acbbd94c00d092979cbb49f4edf99fb79e |
|
MD5 | a38bb62affb67d5ddb3c580fa0e66104 |
|
BLAKE2b-256 | cfba1dff061b7f48a9180257b9c226617c768f350add1ee4f597f61f3f05e441 |