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 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.11-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ee46d00fd1fbe84ffd38eb6446af0ae70293bb0ef7d1fa84b6e8526b2db386 |
|
MD5 | 1cdb002410132a0ea2a16e64b394eedb |
|
BLAKE2b-256 | 70fc7dc4400a108e7ce7c170cec27538f795fdd00cc335c560b9374d73a13f59 |
Hashes for bitcoin_explorer-1.2.11-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68e5b22d825eaf4cc7783ce86d5e95de289e982a677abddc0f1cacffc2170a22 |
|
MD5 | d90ec037f3eba5fbd753271ef2dd9b7c |
|
BLAKE2b-256 | 56856c8977e62264c51fa3f1f6643509d4ecf263ca8e19a9e8b65d261d0ce8fa |
Hashes for bitcoin_explorer-1.2.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d188b0fa4202fd22c6ce79a3b0328447d56c3a1c3ec8f8cff011cc9ff8302157 |
|
MD5 | e5badd1907598e6e335ba55280d5f0b8 |
|
BLAKE2b-256 | b3003249315caba99223a91d0274a085cf941db6b127ec570427f35e1dcbf26c |
Hashes for bitcoin_explorer-1.2.11-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42f82ead7da96186bb51058c0313926097594c295f81bba17002d21c2fd58e3c |
|
MD5 | 70aa478d766929f358e06e18d63068de |
|
BLAKE2b-256 | 046594bdd2d59ed12cdef6619c3ddf329c56aff0bb4aea34e520aae39ed4314d |
Hashes for bitcoin_explorer-1.2.11-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f65cc3f29ed73cb1a9b6d3e1c88ad33c45aa26a8bc8c9204ea9449d680a7d7a |
|
MD5 | a07c929fd02e4770c80a38b2de8d7280 |
|
BLAKE2b-256 | 816ff6e78eea50504b274c56dba5d5a379f11c28587e2afc4b9d8ec21da252a8 |
Hashes for bitcoin_explorer-1.2.11-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b597663e18125053aa0689002989ab94de237e317ecc4823173473ceeba15218 |
|
MD5 | a8e2c50f7433b6cd33a0aeb38d16365b |
|
BLAKE2b-256 | 0495d6cab7f2b19ec89d88f1aa85f6cade9cd5baf86c6afa5d0d5a9aa9cef627 |
Hashes for bitcoin_explorer-1.2.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42690713f42247c3c9d0e59ccd15c141748bb1c8dff0868c2a41061eae8c1692 |
|
MD5 | a94b4177560bd8e320a52fbe45974ce9 |
|
BLAKE2b-256 | 61e96b46ba9e4e2f0372fbea11ad5b7c82bf8be03d2a7bc3e84e427943f992a0 |
Hashes for bitcoin_explorer-1.2.11-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06168eddb6747a9e7fc2e0dc0ca3d8b7397e863c80d138e8795949df176452a0 |
|
MD5 | ffdc9cef7f7cda2d2c464a493a94e4e4 |
|
BLAKE2b-256 | ae6e11e2cd52432bfcbacfde54c8e7a2e0eeaaa4a7cd81e24ab92a4a7ca0e32f |
Hashes for bitcoin_explorer-1.2.11-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b52bdb88e3275dc6541c2dd3831c60ece0e7ee853aab8b002670ee968be91a |
|
MD5 | 9fbb887c3a1b56112da34488c243349c |
|
BLAKE2b-256 | de98aef7727b509a169cc6d861a0e72a9dde4e3010917a3182088381e4159729 |
Hashes for bitcoin_explorer-1.2.11-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e3eaebb6a78fb29695bde81f3775aab0333d12e19d9272a7b4f72ae70559aee |
|
MD5 | e584d2e50e88297e20726c5d895a8946 |
|
BLAKE2b-256 | 7f8fc5d4351ee7fd0e04856a2621f13e0bdd79025a5107fff8be6613e3fdc8a1 |
Hashes for bitcoin_explorer-1.2.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b70eca2115a71762a22a6e5c4003822a49100215ab5c701d6b7a122c2cbca889 |
|
MD5 | 5e8a1f6216538fe93e405b6f0287036c |
|
BLAKE2b-256 | 6e8a56aa160b46f287d5c4f0f897cb7357efa34d9073e03aae52754ec9fa672e |
Hashes for bitcoin_explorer-1.2.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709256007520cc9a378dee222667eec9248979aad6545a56f6771591e52ac87b |
|
MD5 | 6a8626f06a48adf8969946c8a16ecdee |
|
BLAKE2b-256 | b1cc354f8231cb578ebba1790cd4c2904bbe21c454ae4fbe4094dec275433f5f |
Hashes for bitcoin_explorer-1.2.11-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b86b8b2f312a1aab888ccb3c2bc5e067debd21b37b6a1738526a0fe40a40465c |
|
MD5 | 10d69228fe8f73029b8330ba3b286971 |
|
BLAKE2b-256 | 76543fe42867d8b47ae145182b0462d9067bdd1f9e0ee3a59c41e712f99924b1 |
Hashes for bitcoin_explorer-1.2.11-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 358635d18417f58e79a72fe24148d0666bd66d9bfb9f70819aad371abdc0ab55 |
|
MD5 | ddff59874bed5c8aff0c697e3ad8ebe0 |
|
BLAKE2b-256 | 91a7d91fcfc7db3ac8d16a36f2c9f874c0b98c847d0f4fd44df04f9016e14be9 |
Hashes for bitcoin_explorer-1.2.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e91e5c1c4dcf441d0edf4ef988a316782edc8cbabe0cf611cbdc9dbf91d541d |
|
MD5 | 955a5a4042b607c4c1116087ee1487a2 |
|
BLAKE2b-256 | 78e0b652c0f9fc428043f97767bad89ec81e6913037fe8c2b0274b0fa41b5ee2 |
Hashes for bitcoin_explorer-1.2.11-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2970316e21e3b17392bd9223f03a4b29be95e41152fd0243d049ad6eda55dc13 |
|
MD5 | a0d23814f8045945056ec261a5d0ef24 |
|
BLAKE2b-256 | 0cb5d9c3a26fc3327996001b3c272cd67e05fc81d10ffca4a6d27cb875edb7b7 |
Hashes for bitcoin_explorer-1.2.11-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17bcaae4719ccbe406e4dd450476140071a999d10eecf4cb61fdab99ef063b94 |
|
MD5 | 6ffffdbf73599b47942f2c9b3840b51d |
|
BLAKE2b-256 | 0f856256257f5af768ab42e23a013260e1d7aa6578147ff38b27980f121cfd3d |
Hashes for bitcoin_explorer-1.2.11-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b5a53f9d0d6056aed219d017f6672a6cd719f1d37cde80431c9144365077c0b |
|
MD5 | f1dd4cb4cd7cdc7b17e98e14829d3e6c |
|
BLAKE2b-256 | 3e09524d4626b1e32ed91709ad1781af815bdf94a729c86c188c7dd387864601 |
Hashes for bitcoin_explorer-1.2.11-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efff1fc3260ef8d8cd39cc8e2451d12d07c27b1122445dadf358d8a4268c5a7c |
|
MD5 | 48425c2065b053d48212adfb702100eb |
|
BLAKE2b-256 | d99fda833ee5c4901d3445f5121e02e616529252ed616268dd556bfd2f0c976a |
Hashes for bitcoin_explorer-1.2.11-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c768a32b1c805f1330688b0d13e0d95f8281a2e574314d6c40a61158e0af4ae6 |
|
MD5 | 6c5ff0ceefc9ff7f01fa260fc0708bd7 |
|
BLAKE2b-256 | 79a116c7cedc8c063e186f3957a2a602c2b704b1f9d6c4c2041e44780c7fd488 |