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.6-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5606c85a03646adca190542a8fc38fe83581180783f67231d2f8bbd357da57c5 |
|
MD5 | 8128c611b7b6ef32ea32c1f302c1dde3 |
|
BLAKE2b-256 | b3ba21c9f3948d3cccf076ba7d78ce4bf6e1b40d5516772509defa389d650ba0 |
Hashes for bitcoin_explorer-1.0.6-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2ee3176607fe046b5e28fac92070fe255c7d717ead27d1448ce9476cf3a525 |
|
MD5 | aaf52b524a36e66aeb5ea68499ee018e |
|
BLAKE2b-256 | 2af81660785418328305f736d71bdf7501ffb4beda65ace96c2c3470b00acefe |
Hashes for bitcoin_explorer-1.0.6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d0e97979498ab98aa13f0b63f57db49b3df92e9a31de51fa4de55056b9a0f16 |
|
MD5 | 9aeeda2baa7f9c65a44b16fa136fd2c8 |
|
BLAKE2b-256 | dd4f14e756273043fe7c92bf7b6f590cf0d4907f5216f4655721b7bf908a991e |
Hashes for bitcoin_explorer-1.0.6-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08ec60722133cb60facf6342be7b2301811b1d4214e45a59a257ce4af306260f |
|
MD5 | 6107b98344d428b697ad80ed2d9593fb |
|
BLAKE2b-256 | c2f78b69503e92e22c6f898e8f1b8bc1ada01765c5c4f032de6ed9f8606715ec |
Hashes for bitcoin_explorer-1.0.6-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3204656612923036bc94995f22cb80cf56af397f081c616c679274a66c75d95e |
|
MD5 | 592a4b8a1521d5024d8df2b56cfde1ef |
|
BLAKE2b-256 | 920fd7e654f9fc66ffe21b1b2c9a91307dc71b20cd3d8c68a773b91492ee9a09 |
Hashes for bitcoin_explorer-1.0.6-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0208402245a26e82ec5b6fffb9d82ddb766df7ea5bbc145eb74bd5403549b1a7 |
|
MD5 | bd7fa92d546058dbb4df27dd3944173e |
|
BLAKE2b-256 | 3beeaf984853f7ac7614accb8ca3730b4f7705919424a881348fa951d3f09603 |
Hashes for bitcoin_explorer-1.0.6-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e6d5dc1b26dfc450c395f04c7e1f94531c8300e997f035640d2a77dc539bfc |
|
MD5 | e9afa2314dbdbc673ee1fa3bf5e0baed |
|
BLAKE2b-256 | 1734c05eb746b2d4b0b48b5a5b6f1c0b8f10b49ad11edb635296c3639a8ca44d |
Hashes for bitcoin_explorer-1.0.6-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd2dcd53d42d821954441939d29b0ae910453cae295180c6f3d1b5adf0782be |
|
MD5 | 6ea848c26c33af2fd619b453d7718f14 |
|
BLAKE2b-256 | 1393fbc8309506cc4524218f68d7a98d1d9658b6158655fee9f121af632fd79a |
Hashes for bitcoin_explorer-1.0.6-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94d636a8a4614f3d32897eb826860db07f105d4ea37e965a2e25956e1c110a36 |
|
MD5 | dfcc8ef50883108284c543b8b4a174af |
|
BLAKE2b-256 | e7a60d0101d32cceee11916f670845b265b4bcf2c4004fced98157845231975c |
Hashes for bitcoin_explorer-1.0.6-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27db22a0a1cc3d80df0bdd9bfc06daee567f423a37f372a49a4c2b097c6bad1c |
|
MD5 | 999683a187a5e673ceb5f6d16fe990a5 |
|
BLAKE2b-256 | b34a9f4c08824d1cdc4e4bed87ce237e77f97d65974e9b823d28a800b64030ce |
Hashes for bitcoin_explorer-1.0.6-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f08ec9e64abf0557fd58d79b5c6dee49b7538c5b395a68f3d25b6c7aeb6ebdf |
|
MD5 | 6aea0cc93c18680bc250f1b22bc01a03 |
|
BLAKE2b-256 | 4e9961c8bc107b2e77bb67174d72364624ff592d2a9a0a522d178ce63fa06f38 |
Hashes for bitcoin_explorer-1.0.6-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa6ab179abad556af386869917e9f17dd7ab974c6b745fe56feb31e029c6b7d |
|
MD5 | b930dc3975dc5ea9ace501943636ad9f |
|
BLAKE2b-256 | 77afa89fe7501b4eea48f4c658d57f1e74b25fdc899015ace7fc5173784a1d12 |
Hashes for bitcoin_explorer-1.0.6-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 598cdbe361d25fc3ae8e70b5fb0a75c6d8ccaf51b9c2d95ff632a2d9380b5e78 |
|
MD5 | c48f0a08a822d70e40d84c1a9541a51b |
|
BLAKE2b-256 | 3009a2fdf9dec42b5a6bf366405ec8088add4fdfdb7af59655454ef023e47fe1 |
Hashes for bitcoin_explorer-1.0.6-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78576509afe6f08384cf74caa153af05575a49bca6cf334904e29a17a36a9bf8 |
|
MD5 | e12cdc84c038df0d3fe48db682f1cb68 |
|
BLAKE2b-256 | 32863150413e3ce2f02c8ae4938db773258108d38ea9d35fdeeece6b706b7bbe |
Hashes for bitcoin_explorer-1.0.6-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e19fa675ea891cb344bfa8be11b3b198f1520c676ff915dfea045e03e1fff5af |
|
MD5 | bc077b5d18ea68076efa5e8917a2d580 |
|
BLAKE2b-256 | d3308060f892e4d5a8100b1927222f4a0eb2e5637ee1ed9c5f9f3df8755b15c8 |
Hashes for bitcoin_explorer-1.0.6-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa4c33243fe4f110b499318a99ab5d32616e99a29a3a949613ce779b037e5ca8 |
|
MD5 | 77c68b0d52d4665228b27b47d645b838 |
|
BLAKE2b-256 | 2fcdaaff017403512b1f0b0aa1a1264f0d13d7613698b40bcb652117b23b1702 |
Hashes for bitcoin_explorer-1.0.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3928423a92cee193731a4110710a7a2ac4238ccf2c7924c8ac826b8857e1a5 |
|
MD5 | b35c0b9175e1662b35772c5f843b125b |
|
BLAKE2b-256 | c15a5dd582572b776e3c473a8f88dfe3c9056ef658602e11823203e02b476f4e |
Hashes for bitcoin_explorer-1.0.6-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 956a9da70e26918c123c3b47ce672cb2b1d03726a1899ab5a8d8fe435c0b4480 |
|
MD5 | e1d412b4529f4f9df1ad7cbe7d7e9c2f |
|
BLAKE2b-256 | 10231e1cac4a1d3fe0a0e1c1931524dab78062e72093f46f430b069ac1686c5b |
Hashes for bitcoin_explorer-1.0.6-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d929ea4bd4c8eeac9717e89048c51ed3ffd6d6a9f36804c3cb8a78d74980266 |
|
MD5 | a22135c863a1058e6558d3befdb92015 |
|
BLAKE2b-256 | ef00c9070b7a3f53204bad2a668075d955cecef0ae4ee1234f97522895965835 |
Hashes for bitcoin_explorer-1.0.6-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d86fbb6ee42288ec7c618ac7634724a2dadbdca25a372553e0e5479138d80ce2 |
|
MD5 | 6172ca230fefddbc0e54160e4fb083ac |
|
BLAKE2b-256 | c6eb74cc73322cf67e69c483d1def7ceb2a6389545e2a7a8219d892316b90f95 |
Hashes for bitcoin_explorer-1.0.6-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba497a1a1a90ff61795e6ea7154502b09c11f1762259b2615b6058f9e7cc17ff |
|
MD5 | 446f9a4ff3e8a3393a09b5c47031f79e |
|
BLAKE2b-256 | d5b9748dd0818779977a418c400aa362a6698166be4b9760ce648b4a929cbc2d |
Hashes for bitcoin_explorer-1.0.6-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67ad471a50f9deba28eed0827e724c20229fe02d1f9666c28d9ff741022bc7f |
|
MD5 | 8cc7ed3c2b09a5be9ab8e1ea0bdc324e |
|
BLAKE2b-256 | 38f0d1ddfc059fff7f2ab69df4390c31f5159dcc8cbaf482972a1d377a514ff0 |