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_block_count()
# 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.14-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ceb63c3dc57690a95788e126fac648d204b566bdbe2a3c3b371279ed4437503 |
|
MD5 | ab4a51ee61982fc6f4f43b6295af4516 |
|
BLAKE2b-256 | 54f3b4ac37353ce4f728be00e4e279cfa6754ca1295830b5dd95169b1b2bf1d0 |
Hashes for bitcoin_explorer-1.2.14-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3302077d056d89c58e317a98da6913d0fb38b89c039ba98c67513e66b426bddb |
|
MD5 | a946456c07d72cebd38203632413e307 |
|
BLAKE2b-256 | 8fa9016ffa9df5dcd5506daf2d1952adaebb8f67a0c3a89c60da0cbefd32590e |
Hashes for bitcoin_explorer-1.2.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b708447bc9f32165f34bf1f221241ea3a3d1ae4c0b75655316eaef17c2a401 |
|
MD5 | 447eb228ee7e66dc696db9e1915ba70f |
|
BLAKE2b-256 | ad64829d50abf6c67d7e6ea992cd427d6171d5af9214c8cc1bbe5a579420f60b |
Hashes for bitcoin_explorer-1.2.14-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64c8c8cc524411e10fd50939a99e6f59babf86d89e2357e52ea2d90c1a75487e |
|
MD5 | 16cd28ab46006e945ace9b89eadb131a |
|
BLAKE2b-256 | ecd269454cc3d1301e3d1e0d343f2ec2553f3b2b0c70a22d6fbcaf3cf0c85d59 |
Hashes for bitcoin_explorer-1.2.14-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6601fb38da4d38e95e5964607a790344060279b123bd2be6813b49335c736e16 |
|
MD5 | 73d0501876d4d84d1b1a91950cbe5cd6 |
|
BLAKE2b-256 | 43430fbe1769c3aaeecdc2aeb07793ab532d5031946293e53c797bb8d2ed9a2e |
Hashes for bitcoin_explorer-1.2.14-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 458e4c0825cbd25928ac63f9951536e28d0461135be6a5e0b573b11d90863ec4 |
|
MD5 | 220a83082afc4e66deebb686f4a6cf2f |
|
BLAKE2b-256 | 7554d4ac737e6048bf7d68bc8fa57443e3b88e12d264fa961b193ae930b62bb9 |
Hashes for bitcoin_explorer-1.2.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b052f60d375e556d2b340b9f66df205a87df7b67ce61200200f5bc203574f80a |
|
MD5 | 51ef657e4943e460a896d017dc91ba66 |
|
BLAKE2b-256 | b7315d3f9726cd883a99e37236f480414b72c8e2e12b59d8798637dae7b3e28e |
Hashes for bitcoin_explorer-1.2.14-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0370e5898271a0d75cd3251eac973efdc6a731876b98cf69bc0ebe8b1ec6a342 |
|
MD5 | 094e161dc2a94856ab8240ec207ff105 |
|
BLAKE2b-256 | 0a23a3f4b714a93bbc5b7f5c74bb807348510ca06f5b61004f5e026162881206 |
Hashes for bitcoin_explorer-1.2.14-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff833cc3ecfa0135e7ebaa81d96948e5b68c5d53db6cafbce2c93560faf0df7a |
|
MD5 | 0849818c375992e5ef7c02447c684625 |
|
BLAKE2b-256 | e633912ca86ca2b65d90823e5c4144cc103cdba3ae3787a903c0b71f6eb902c2 |
Hashes for bitcoin_explorer-1.2.14-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b547602bf20b9e90e4d495e381f57ed2de1df0f0b981fc06773b4c5a64774290 |
|
MD5 | 79e1836713ca6ea37670c0bbfe4d9075 |
|
BLAKE2b-256 | 8d262088718e78a2b0697149ace88f15ae6c6a661df5666b429b832712da811f |
Hashes for bitcoin_explorer-1.2.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cf1f5c887190824a05e6a71d5bdc84e8fcbdbfcce84faf6cfc3e4778c5b1a91 |
|
MD5 | 79405dfec8c9c12bbf1120d0ab8ecc4a |
|
BLAKE2b-256 | 98c482166ec5cef8c4930b94e44b9e068382b093cf1eff5158b15e92a381522c |
Hashes for bitcoin_explorer-1.2.14-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a25de1cdfcb8633fde5c10f523fed426a598879a6157c8b65fbdc24f09f5d8e9 |
|
MD5 | bc6b2a2a730eebacda20b68bf3135808 |
|
BLAKE2b-256 | 03dfdf5b4a318039ea759acbc0e56327f76807de15c42e1e8546d87caf4235e4 |
Hashes for bitcoin_explorer-1.2.14-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 064b62ffab417fb0fc7a1046e49f036aae041f43d771f00294eecf0c28d8dc66 |
|
MD5 | 535ca81fae8ea1047e76651b4f3eaf01 |
|
BLAKE2b-256 | b4f0db406682d2b2fb31862b2e0f0647f55f648fa7fc238d09b2fedaa0d0972a |
Hashes for bitcoin_explorer-1.2.14-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 831bd2043768eb05d6e2a04caddab03a508251ba36a5f1da2e58e75dca84e62d |
|
MD5 | f44ddd308e0e01456740ab372d43aa38 |
|
BLAKE2b-256 | f06567fe6bdee1015a54053b680c2a6702029a15fa861535e4a389e736ccfc6f |
Hashes for bitcoin_explorer-1.2.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b004000296182f205ee7ae59efb72465d59261f9d5430a75b3a8580b033924c |
|
MD5 | 87cd8b896b9c553167aac803aff35c55 |
|
BLAKE2b-256 | 102e0ddca9a8969ea0ccd1105d5c022a85b579b9d32487b2a677f440ab46c509 |
Hashes for bitcoin_explorer-1.2.14-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2b06511ca5249f82296aa683579bd2043b585fd2077efc7d6de60e7250b90aa |
|
MD5 | 5d117335c2caff2159e24f7bcf52bd67 |
|
BLAKE2b-256 | c93ef17e9716896baf7df30467b1f607b26591386f4cb662010a5a57cb132ecc |
Hashes for bitcoin_explorer-1.2.14-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2912e8f11437b6eceaa65c8733e59cbe2a1cf2101c93f97e23287e34a80f7730 |
|
MD5 | d18a6b3f6e9b40bc0baed3fd7dd258e5 |
|
BLAKE2b-256 | ae03d169de00db16308967393e9dae2b47c9761db13675fbb6fae552a673e258 |
Hashes for bitcoin_explorer-1.2.14-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca66ac3b87174d8c81e1dec22ef5faaddb07bd6c8d43b37d3de8a127c45f0345 |
|
MD5 | 60e701edd45d3c291ad8537e5c70cc5e |
|
BLAKE2b-256 | b2654587bbb42d7a2b1e28382bc61964c2a067fc00138b3d28a2a8f2de417943 |
Hashes for bitcoin_explorer-1.2.14-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2882290763b8c238496e0618e6e9c67f856460c5e94b695d18eaef3bedadf8 |
|
MD5 | 67f139895e336d9eac611a6724a5c212 |
|
BLAKE2b-256 | d59f93ce2ad73d2fa2626d627d0470453f7150a9a9abc5ecea3051d51ddd9673 |
Hashes for bitcoin_explorer-1.2.14-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29a54d9b739af8235723df07745745d9dd26b05abc3204fba4298cb17f63f2fc |
|
MD5 | 43a66f869a534044e34d5961b463fc3e |
|
BLAKE2b-256 | 503ec9ddb9ee90d5830d7498bfad4ea5c0af795d3b1c5de647e2fb44c73051f5 |