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.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a163e437cddce2641173026b980b5e386c0cd1ce34c70dfca208cf47ecda160 |
|
MD5 | 8c4aa6d9ec4fd498c5bcd7b73d43e479 |
|
BLAKE2b-256 | 05f84fe81c236e09b70738a99e3de5211bbf74fd91ddb6da92cf317a132663d5 |
Hashes for bitcoin_explorer-1.1.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d8c7b92e8657452e128743815b8848396bb5ea49683bda23f71e877c7534ed |
|
MD5 | 6fc7195ccbd42b5d9ca94016f326d9f5 |
|
BLAKE2b-256 | 54f9e217684cb78ab76d80d061155df7f5b7db3f1dfc33a62f40a68964e5b3e7 |
Hashes for bitcoin_explorer-1.1.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8d501860b7d661a810ff0ad773d1024219e376434b64a49914d5340b0a3cd44 |
|
MD5 | a711a169b78e6346bf4118f608e4ae0d |
|
BLAKE2b-256 | 4a422940036e5ed1160b854e337d16c80921dccb61c606f98dd83728b915db78 |
Hashes for bitcoin_explorer-1.1.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fc6e20d738c1247c2f7680f7e995a79c8eae2cf19ed96824f55ae9f0c61f363 |
|
MD5 | 5a9c1a868246bf6b7b987853fb9fdaba |
|
BLAKE2b-256 | cf21ab680f57a98ee069da208331d9bff613e77edb43cedcf3df324459089f88 |
Hashes for bitcoin_explorer-1.1.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 469ee26839e451b64a3c6f34b5ce735dd385bc4d99b2087f7426ad17283ebd76 |
|
MD5 | bdf7a701784c3e0443bca732e85692b4 |
|
BLAKE2b-256 | ae9d0b10091806ffa73062a3929daf7beaee614fe508de766b7833a0c220a487 |
Hashes for bitcoin_explorer-1.1.2-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b11c69605694f3ff2680a88979b1a777126e877438823ec65e07843194e73a98 |
|
MD5 | 7e8701673a640ca192e44acedbfac23e |
|
BLAKE2b-256 | 1ca7e99475933303b5a589a3155dcbc575fdb4e03dc717960e512d889db24ed0 |
Hashes for bitcoin_explorer-1.1.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0956a1817cadfab5d36753cd1ed243f740d8908b96dc4205e5a77927bb3a4bce |
|
MD5 | cc60e56c63f7477850bfe009a5ceb99a |
|
BLAKE2b-256 | 43aca993403a52d338854f5ad18a8439644a5b22727dce345a64673729c78ab2 |
Hashes for bitcoin_explorer-1.1.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d33b2e26521d6202fadb738fdd9483db34532533e9175c2a85e0383e408e9a53 |
|
MD5 | 6edd2468dec018d2d1fd8b5965ecd7a9 |
|
BLAKE2b-256 | 456196e792b5ecfb9cbd1a7492999dd51575c34bc58df02244f056f58c50407b |
Hashes for bitcoin_explorer-1.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f878a8576731146c9786acf9a8b7128669de422377842af58aefc5eb6712d0bb |
|
MD5 | 5d6837dfbce29bf557c2ed3b71b9c610 |
|
BLAKE2b-256 | 852018fe67842d75bbaa35e7f6aa8b5b4e35c17ef4d882973d0eb7ccaaacec5b |
Hashes for bitcoin_explorer-1.1.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fca29f07247ce3adc3b66ac0f40cebae372d5d59c6e1a2372864905f2c5f2ec |
|
MD5 | e256c37f380499475acb412321ea5227 |
|
BLAKE2b-256 | 77b48900a559014f38f3d02de13a8366f29e981c157db5b3940b2db58a40248e |
Hashes for bitcoin_explorer-1.1.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c57a573efbcbeaf9f823a3caf6aec7123440771952830d52c8ed03a801a66420 |
|
MD5 | 7f18cde6e706e97c6cf4a89c5c7ab51f |
|
BLAKE2b-256 | fc8c44564758aac71dfce2070956b3144b2156e0125abd411229fcd7b623b92c |
Hashes for bitcoin_explorer-1.1.2-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c8acfdf9832585df7b88043a940969a4618e09ff37101a9c938e226d86c92f0 |
|
MD5 | deee9e24c8c313c9c3c7f7b368021dfc |
|
BLAKE2b-256 | 76f5abbd3ce8365c547c94eee8404401201c9942a1bd25aeddfdd6aa960c10d8 |
Hashes for bitcoin_explorer-1.1.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d9783b99f291b071f50f6ae4f218aeb11be6e8216be2dfac8e6b446729dbd38 |
|
MD5 | fed15102fc5c4f097d5bb5b0757f02f0 |
|
BLAKE2b-256 | 75022370f9a52ca78850cb302600a35dba36ac0c3d3a2e17227910945f94cb5c |
Hashes for bitcoin_explorer-1.1.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f76b9dad0bc9f1e5d904b5d072e62a428bd5ef5978956f9b658b4c690e44d15 |
|
MD5 | dec1e2014a07c354f2d85f9eb0ff54c1 |
|
BLAKE2b-256 | ef5cd0cb27a2286219b03f797ad3abfdf2958bcf961fb4db4915aa9c9225bd6a |
Hashes for bitcoin_explorer-1.1.2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19addbd39bc073365f0810b47fca8205c61f05dcab4bf6aa1c3d245bd1b08b30 |
|
MD5 | 9fa387160b6a40126a024b248ae656ce |
|
BLAKE2b-256 | 30565094564562f7296ba99d959e9a8cc2d8b8cfc7b793b29e30c3e85a6fa899 |
Hashes for bitcoin_explorer-1.1.2-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3ba49155ae7129f9464d5ad6c2d43b891121bc36f6fbee6cd9d53419e42547c |
|
MD5 | 71b424ff9241dd3e8bac44378e3ad0ba |
|
BLAKE2b-256 | 50a96d94e732c0a7b945b522c0615ade48dab5d183bf90e3b917c7e30eb53083 |
Hashes for bitcoin_explorer-1.1.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1362d7e79ffb5c5a716c422951ce39f0e820050af8840d77b763603a80a714a |
|
MD5 | b8f0f4bb33a6f1ad24325787e5882b26 |
|
BLAKE2b-256 | f6e8bcfcd55a428970992f8d83da5aa7162a4b044f0ea59cb5944523e8a88658 |
Hashes for bitcoin_explorer-1.1.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9bfc28251b8c0f9252ad5ac715afc298dcfb1c9c5d612c05b4873c7da2ea09 |
|
MD5 | 2324db96087e9a57c9cef68a5cb14290 |
|
BLAKE2b-256 | 2b744bd5b62e4e5f902a4819aea182c37bb7293c6c9fd437a166b39234ee47ec |
Hashes for bitcoin_explorer-1.1.2-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0948331f7d7dd78eaf7d0197e0312eae5d12cb660eae6b45b685728a23cf8c70 |
|
MD5 | ada4184864fe40f075b954413a7ad71a |
|
BLAKE2b-256 | cedc8eb28565bcec1ab73559e830ce028814acc3f016d68bd2b298c19b275f62 |
Hashes for bitcoin_explorer-1.1.2-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0364a3c25ca0e90af375cf6fc640687cb364f2247ecbcf7077c54227cd525aac |
|
MD5 | 397d4fac8c9c224591b9cca442651c4d |
|
BLAKE2b-256 | cd199f27c3c35a95c2c6f44971b704d033827468c3273bb1db84f6654b6277e1 |
Hashes for bitcoin_explorer-1.1.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 963f8ad72c7883790d11d23627e68df908c25a22288b5c041522a5eb2505d10a |
|
MD5 | b5cb32e3ae98cf60e8c5b360d6f530c4 |
|
BLAKE2b-256 | 59b597f1d4b37e3c5831e5db60627a9f2d122fd4f5a19fb4693794d25a60b10a |
Hashes for bitcoin_explorer-1.1.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e85c42c46dade27cc99f6851529f28ff9335daead06abd1e5eae583b501d44b |
|
MD5 | 876819e492302eaf8948efe5aef11ecd |
|
BLAKE2b-256 | 5b8f93b50b845b4e2b5327710793a1b35cde67b6fffc4f92e9d607e97c795d94 |