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.17-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f056c5dcbcf53eca209c863649a73052b909f79389d00cddfda7a6bdcc4ac445 |
|
MD5 | 6c310bbd9b5771c88030a57deb88f944 |
|
BLAKE2b-256 | 90ce2867f81bf1741df562d9822be32a0e14a6805280eb0982f23a4baac6a03f |
Hashes for bitcoin_explorer-1.2.17-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b93913d2c21959a2d7f89f507f44c47ed96437ddba98efb1d90df9420e4915a2 |
|
MD5 | acc58a3feab03af00037a05546964b8f |
|
BLAKE2b-256 | 42829c0756b96e8e579a9b4d4bfe1b03f2fa965e0b2da50525a4de9c208bf545 |
Hashes for bitcoin_explorer-1.2.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f84f654592b40d441de9676ed2fb7b89526543945b14ac6dfd138009dd3f1ec5 |
|
MD5 | d2a93e8a010827ba834dfac9a3cd9f97 |
|
BLAKE2b-256 | ddd3e3aaede01810ddf456c54552d6c25b5924174acf3110cffbb41711b0a60b |
Hashes for bitcoin_explorer-1.2.17-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72fc713cced29a6c04414dc3d3097cd627f63861e88b8f861b87822ba2e8701d |
|
MD5 | 74e7446d0f3d9a027159a1a83e1f07dd |
|
BLAKE2b-256 | 219f107359c502a18950d75cac8dfc9f2cf8bbc4f410551601f0b23d215e9a63 |
Hashes for bitcoin_explorer-1.2.17-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68fa4e13ab4130f4f027e936270a4e9dc87791e43930f2fe8eca2b6177c75f63 |
|
MD5 | 10f22cdf64c8e79f2b21a5dd9bf17f58 |
|
BLAKE2b-256 | 3d2c6805638f134b95816c59459a439056593e85f32464e5e2a3be9adb4cfd7d |
Hashes for bitcoin_explorer-1.2.17-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfb24258156ffc4f6af35880de477ca87b7837955ab241a184a1ac47d20f97c3 |
|
MD5 | e6b8fd518db9e78bdac2c801647f43a4 |
|
BLAKE2b-256 | d28270dc4895628451bf3e280926bc0ad10c4941c38db173e79d34cabc10228c |
Hashes for bitcoin_explorer-1.2.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df64c9409e8957f1cba755d3a9c724c76b345b4ea68e2005920559c938505f11 |
|
MD5 | 5c36f55f609fb295defc4d3c733c9e61 |
|
BLAKE2b-256 | cd2146134c0dab11a66dad6855dc6eec882d6568a181f006ec6357af037876b3 |
Hashes for bitcoin_explorer-1.2.17-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545ac7dfc10d453e11812ed581e1c88ac845e895a0ceca044d40c62c209d1653 |
|
MD5 | 78bad7eadedfc1d6cb29bb0270687b9e |
|
BLAKE2b-256 | 859e31b12629a199f0222b37b543c9ca32199b12808608ae3e4102e4cb5b2c21 |
Hashes for bitcoin_explorer-1.2.17-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2351f08303fb7736479cc1127bcbeceff134e49a7d512e9e14c0a03516ad1edb |
|
MD5 | 999817db8389ae98b03b7f48dc365cff |
|
BLAKE2b-256 | 157f8328f63d6eb7c8b8516055dd884f188575ac9617a3a70e0ec6dbbace5d41 |
Hashes for bitcoin_explorer-1.2.17-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c0e7f65f3a19c69e863f6bebfe012ba8c1a4085bcdff06ec0706df74c7ea34c |
|
MD5 | 158834d5d234ec8efe3aad60ed3a6a42 |
|
BLAKE2b-256 | 5d167bf95edbc65ef4bf2ee7dc8c43acbbb7591c209943d17fb5d79f6de2eb65 |
Hashes for bitcoin_explorer-1.2.17-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d8f1d4c2153c36a3973bd6b470e65d61f2968603edc769c883bb1816b9cc015 |
|
MD5 | d6661fbba82c3b7c5b8f1bc3efc762b5 |
|
BLAKE2b-256 | 8c628f1345256bd4d7fa43d825fe3db1bd1a464ad12c5131e10ec122ab695d2e |
Hashes for bitcoin_explorer-1.2.17-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6415bb88a0fc9d36597a824fc35c984037a2fe268feed1452ad931c6263299e |
|
MD5 | cf6d5ac396b297633bc1231fe5da7f36 |
|
BLAKE2b-256 | e07a17ca6a42db0a01101d81f8c40926161695a340a044795e93379ff5e93c3b |
Hashes for bitcoin_explorer-1.2.17-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e452088f73fe6c5c026dd1a8458fcde551796a6b1cd71d32a5138eeb4dcee153 |
|
MD5 | b16ce9c3b3a13c14638a729c6289136d |
|
BLAKE2b-256 | 6db2a1c27eb8b694f6d3c0e8ee4f06745522840caa22699efc61002dd65962d3 |
Hashes for bitcoin_explorer-1.2.17-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d0bf66667bf78f581ede0b2c02f29b340fc915dbbd31c17321b8797f02f4ef7 |
|
MD5 | 5fe9895c901661d36677540123952c28 |
|
BLAKE2b-256 | 6cb561beabbbf88c1688aa4d6bf9dde0e704acef56c0005202bb2dbbaf43c920 |
Hashes for bitcoin_explorer-1.2.17-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5f1498d4594ac7d6baff535657b3dae276dbbf34519b388bee49c102b425a0f |
|
MD5 | a7dbda3f0f9f078803ed4539437e382e |
|
BLAKE2b-256 | cd8fb802e6ef2a2c5de0b12782753f009546fa0a133b8df745b3651a9246a333 |
Hashes for bitcoin_explorer-1.2.17-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53b2eef8a12b09377887b17206e4d123ea017a6638a52103c10e64f48612eae9 |
|
MD5 | f274112f98354c24dd23d1a3a4f6a12e |
|
BLAKE2b-256 | 0e8af8ae80a40276edbbf67890ce433719ee4f20c312a60215c78f49c2de352d |
Hashes for bitcoin_explorer-1.2.17-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117d15a407ef03a6def756d37d753b0153bd037f43fa71cdf95b5f5ef106b2a1 |
|
MD5 | 29f0ed85c4db762d09fddadefb1576d3 |
|
BLAKE2b-256 | 4e1679dda24d6b7fbb8c03a7379084e7a915bdb28f7cb35172ff16dc2e002e4a |
Hashes for bitcoin_explorer-1.2.17-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a3cf55980e001f9042642944df19769b9ed00cc753695c8a527365ea386cb5 |
|
MD5 | fb0d56589299f46e67c791e20b32018d |
|
BLAKE2b-256 | 8d2da225841f93316b0d1bccfbb8bcbb858b75ed3247050a31652c2810e88aa0 |
Hashes for bitcoin_explorer-1.2.17-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56432afafedf07c21cf4694ef625fc5a88b764f841b49fc8b0da299228f32203 |
|
MD5 | 7d8c5f4677e098060f2455ec9ebd49c1 |
|
BLAKE2b-256 | d9aaa11b1b403702374e65f360e10a81ea6ffce017d26fa3e45dad30e58ddaf5 |
Hashes for bitcoin_explorer-1.2.17-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fa0970349b572c7e2366d75b2056af990dd31806b9d1e2034c10ebd100bedf7 |
|
MD5 | 7800c474cdf709c36642a021071dc270 |
|
BLAKE2b-256 | 771e2ec0721d1911e33464de76608b8e3298be3701241cc0241c65702e9eb367 |