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.3-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf0948882aad6f15df2fe5a50f6aad343ad2beb1eda4fb66e5881f524060a319 |
|
MD5 | 502d088e81b83e3556dfc122a9e9914f |
|
BLAKE2b-256 | 589e1f70aff12a0a861dbe62f0d92b6e7b419fd88ee5602e102968b1a68b57a0 |
Hashes for bitcoin_explorer-1.0.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b91095bc529dee5d288d266ef95c8e77fa422192affca41728e533ce41d80f |
|
MD5 | 98553e3dccab79ad3ca629591b2350f2 |
|
BLAKE2b-256 | ae8c9d0b4e4ed3fc37c80eb542863a61248ad2330ba145c9c07f4b642cd277bb |
Hashes for bitcoin_explorer-1.0.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee573d81c51466b272c3c5853510b94057762125359cfd38fac469aa252ecddf |
|
MD5 | e91c3f64cad0c65e9436eb5c3adde3f5 |
|
BLAKE2b-256 | 9824e4dc15186c0c9b8bc3cb29f199f754c04479086db77d291248551447e008 |
Hashes for bitcoin_explorer-1.0.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab215c254a36ae5a5a891055aa7ec12969f60860ae988affa65a7acb62d608d |
|
MD5 | eb52f232326699fd30d3250cf29da42b |
|
BLAKE2b-256 | 05632f4b1b5d812df7f15532e742f28984499d04aee94a682b66b7a8f81611c4 |
Hashes for bitcoin_explorer-1.0.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14294c641beb87bbb7345e2cd67bb9e402f87ed5eda0730b6bd5cda52bd72418 |
|
MD5 | 2facddfefda7167cd49eeed2a00151a1 |
|
BLAKE2b-256 | 426ce726564a3fb7d68c3a51aec166419e676ea7c4c66eeb23771cda9d946551 |
Hashes for bitcoin_explorer-1.0.3-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26bdc6bcecac257c741ea997bd92598cd2e6ed8154fa749ca75e87fdcc8b0c93 |
|
MD5 | dfa31df0edd167f703d4807c2d511db7 |
|
BLAKE2b-256 | 6c33fd214b463ca0604c9a5ce4b0fcd2153e4cb0f53e02387598d47ccfaa7191 |
Hashes for bitcoin_explorer-1.0.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71c51510ec94b4b546eeda79884b966532295525e258a9b22531cdb47fdf8490 |
|
MD5 | f92b553bb0903a5acc10a079967bc3fe |
|
BLAKE2b-256 | 4f1e2de7b797325c9192d880441e5e9c3b950a28563d747718a6403cec5da7e9 |
Hashes for bitcoin_explorer-1.0.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882e298cb2e1ebf9a6a169d13a4c2ee71e5e5589db8bf8f818cf018d31b32f6b |
|
MD5 | 7d6a57d9676ea0aca63bb920a3c54b6b |
|
BLAKE2b-256 | 4592486255f582e44a8512a76c44b73f484dec7e4eeea47119795b72856683a1 |
Hashes for bitcoin_explorer-1.0.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54138e7760e48ce8ed9b750fff93ead68735de30172736e55716387090226e88 |
|
MD5 | 4485f140d204ed7fd04301eef0d8b8dd |
|
BLAKE2b-256 | 88816c3cca00235466a2d172562ded17b08d738d8e360b054410a7b021f9d147 |
Hashes for bitcoin_explorer-1.0.3-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa6fecd8f23fe07f0ad40af94573455725d669f67427215073eafbeccb584f7a |
|
MD5 | d669f5a0fe8e583acee920749a0f57a3 |
|
BLAKE2b-256 | aa277ad6fe6ac9b6b36087c27578366d0534e4d08be756e206726cefab08865f |
Hashes for bitcoin_explorer-1.0.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 189479a80f0b74ca28af6a3deed4174d7344494494befb617cae54fa74d710ad |
|
MD5 | 790d92431ec18002781ad86321f37cad |
|
BLAKE2b-256 | a2e8e3e376e2a4797918a6cdffb57368b08ec8eaac8c79c4d291f60db8673c96 |
Hashes for bitcoin_explorer-1.0.3-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f1376fe9cf0c4734792333ef4492fad9bcefc769672ca880d82d10562cfb446 |
|
MD5 | 7ccda6eb9ed2869d430ca55bf319e448 |
|
BLAKE2b-256 | 2602ee1551772b43fc15b6572a9ac83fb6594e7ef52cee45b78df4c3e3d2e88d |
Hashes for bitcoin_explorer-1.0.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f986d980207b110f2890ec9597e2cd98628bbef7a5413b18b4156c5c180169e0 |
|
MD5 | 7b70397b3d198567334e39af535862af |
|
BLAKE2b-256 | 0c26c8b6289d893d431ca005be2f5d0bd9d28c37002c9de56b5044cd420dea34 |
Hashes for bitcoin_explorer-1.0.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bc491733cdb226e3d3a28cd3a9b2ccf1b96fc34c66206f30095c9fbd582f5f2 |
|
MD5 | 6677b32e91e17fe95dda283af4c21ea3 |
|
BLAKE2b-256 | d5212f2fd379da8c3342409754541f0d1fe369bb82b016e5a2f9088446eeded4 |
Hashes for bitcoin_explorer-1.0.3-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce0621026ad9b3042d529c3728af799dd929a93756abf00aa22bdf1d18b8fd1 |
|
MD5 | a6e783500b3cd709b80b0c986f3fae1b |
|
BLAKE2b-256 | aab67d086978a43ff51449586acb42ade74dbbb110ad7aaccf2868f256ebab5f |
Hashes for bitcoin_explorer-1.0.3-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc99fc1fff51c33d85bcc387747b219691eb020eaf037a4e0836caf715bac11a |
|
MD5 | 7ba09f22d9d7fef4e227b9f57b9f9949 |
|
BLAKE2b-256 | c16c302f1256616d93e09fb9696ca4e9e5f8a98de44e9ef48a92fad44e83e864 |
Hashes for bitcoin_explorer-1.0.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c860d92654f7f752e113f59d7ed35b3729b8ae8dd595f4f9fa8448fa265492 |
|
MD5 | f4e8896187ba6a4c1a2547a7d7f083ee |
|
BLAKE2b-256 | f46e4d7d42b8f2b92961e413e86acd32d54d40c423a570627b00fdf53a6ecdf2 |
Hashes for bitcoin_explorer-1.0.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67e51c9c7a0b937a97483627afbc9efd4e1a79a399434b9e1de7d904d0e47e9 |
|
MD5 | efd66188b5518cff63e00dd9f3f9a8a8 |
|
BLAKE2b-256 | 94c2fe013caf9a591563d9dd57cb22f3b8f2383b1f39916eebfeb2bf951aa0cd |
Hashes for bitcoin_explorer-1.0.3-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d214ab4eadc229ffef5730f7d4cb7195134a7eef4d93969d7aed9e7b32e744d9 |
|
MD5 | eb7b37eda448411bc83a31fc446e88ac |
|
BLAKE2b-256 | 91de14255c6f0f31ac3035ab32c0b1f8971efa5478e7375191378c00cfe2bdc2 |
Hashes for bitcoin_explorer-1.0.3-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 659745a2c3973507e5c502e5ece381b852a97f2b7ece6cf7e4a3566b87339fd9 |
|
MD5 | 9eebb5cea6bc5d724211d70407ae9385 |
|
BLAKE2b-256 | b1dc9964702dd614467165af6b0b0961968f00534bfe9f235ec35ff5d83aa1ea |
Hashes for bitcoin_explorer-1.0.3-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef76565e645b060c8779961a0807c72f9190ac7d0721483322908cb49fac4b80 |
|
MD5 | 4b32a29a380a3473885e59902b8e2446 |
|
BLAKE2b-256 | 8dc55efa3293a4272d47a6d041b2c3b086f6734e506dbf53c9ced53f2dff92f0 |
Hashes for bitcoin_explorer-1.0.3-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad5398b2c8875b063acec7af0b3397da444b3d05297cd7fa760b8f04a962229c |
|
MD5 | 658e331641f7b45e2b3c9f4a68bc7081 |
|
BLAKE2b-256 | 97be6df24f6a21f17469fc53002cb2cad37d1528323d099c0892268356e7c342 |