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.13-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9af08ac923d3f3d5501eb36632aeb0744c51bc839d3839ccd54254480413a957 |
|
MD5 | 903ddf588a24589b8dd56fbd3005d054 |
|
BLAKE2b-256 | 3e3ad3fdb8f4195f502f354abb76ccff718c915a4583a0f72b5aa0a36824e08b |
Hashes for bitcoin_explorer-1.2.13-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3ff8eeb8221204c9ceb8dc6feb8124725ad6bfa3a9bc5328f032ae8923cf444 |
|
MD5 | 8d568dd7023455612bcd2e604ecbccec |
|
BLAKE2b-256 | 9ee3496aff9c1c4335419a6156cc248c5a04b02d6dd8db3b9194cc07a7bb0e9a |
Hashes for bitcoin_explorer-1.2.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 202f5acb345c0183a92e298e7323c51151041274cde1e17107b3d2c70c41d3df |
|
MD5 | 338851d39ae3123a4160897e0762f597 |
|
BLAKE2b-256 | b28ade4d8344a4a075e7fcd77725270a6256f5a77f38a32d520fdcd6b637dc69 |
Hashes for bitcoin_explorer-1.2.13-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ba82b0a380e9196487913f11e2af39bf74a92342b6aab5ad1f940f352805142 |
|
MD5 | 59ecdde33cd2870035266e28f52764bb |
|
BLAKE2b-256 | 3fb1808ab7abf4ae9192c8e1ee7988a22a3ce8bca8a2e08f916d94e8421ff993 |
Hashes for bitcoin_explorer-1.2.13-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbf31a8734e11f0ee9f6a2af771f0be90f4772ba81f69585254a3f3b2c26cd35 |
|
MD5 | 557d73c3a9d3c294c9cdb05c78744e90 |
|
BLAKE2b-256 | a03b7327d1fd78f93e16e6379efe91f267eb7e321a320b4582486d6c3033ee5c |
Hashes for bitcoin_explorer-1.2.13-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f8ea84fab91544de5637a18a9be7c6ec8f0c4b3c0d0096e369f6af529c2eac |
|
MD5 | c2f80fe55eabbfd16a777e6a0c49586e |
|
BLAKE2b-256 | 8f8a9810bd9d32e3c233e5798ad732b1a9947dba13d666c3a170235555ba7129 |
Hashes for bitcoin_explorer-1.2.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b0388945afecf9a7610608c339dc6390ff39903ba529937c948ea25700ae53 |
|
MD5 | dc715830973359dd54d2075184e5e6bd |
|
BLAKE2b-256 | bf9d11048ba758401a077a332ff520ac0c4bec49865ee9eec2d785779a35e91e |
Hashes for bitcoin_explorer-1.2.13-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7aafe77326807bd16f58b75a2628f2055cbdb95feecfa21d8439ae65a671fef |
|
MD5 | cf6fea4c1ef1e051e217fdb5c3b7b5e8 |
|
BLAKE2b-256 | 88011116779b89b1a7a501d81d87d82e175725d9aaaee352af538807d3b50226 |
Hashes for bitcoin_explorer-1.2.13-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 904daa1021f1ea198d13f5487d8b8cb8b1ab9755e00cfe138710b45b6bae7358 |
|
MD5 | 6bed24c09c40efde0efbf863059677ed |
|
BLAKE2b-256 | f4f5bc54efd533903b0071edd18e024cb7af84676522c3d644a2ddd849cb4307 |
Hashes for bitcoin_explorer-1.2.13-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8013aa0fba8d8207136c80da5b525520e6d6440e34fee76e24cbdb5c0908a77e |
|
MD5 | df1dd21e3a008e41ed04079d518853c4 |
|
BLAKE2b-256 | aaa6c34556a7d8c64ed0da9b05427ba173fbbfbf1d6e32637739cc7c335b2eae |
Hashes for bitcoin_explorer-1.2.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dae683d1514b89cfb655e8de4770b1a7167311f14ba0f0586b05effe9910b550 |
|
MD5 | d5700e5edf8cf171b996d4983282e69b |
|
BLAKE2b-256 | 33cd908be43c0175818c27bba5498221a38b92ae641431e4ee93578a5ad9cdae |
Hashes for bitcoin_explorer-1.2.13-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bab2ffb3c6d2318b33b10a59080b162344b8532b94f322540ea446f2ee57641 |
|
MD5 | 5402e2259223f00dd8a8d7f608c13939 |
|
BLAKE2b-256 | 6d0245709f30146997cdb7720d0b13fdcaf11c4bb82df98dc531fedb77e429cb |
Hashes for bitcoin_explorer-1.2.13-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32eeb6062195c0bca738019604d01ca9319358ee1bd92f7752aabcbb3b7acd75 |
|
MD5 | fcdfd78fad47b8c517ec5637fffc85c7 |
|
BLAKE2b-256 | d93869f279654d087427013a42a9c2d1733dec2b736947074a99e437c9509d4c |
Hashes for bitcoin_explorer-1.2.13-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64c3dc70336f6c49a43f06459e9fc2b70001114cef6a8e9c7568658690f302c8 |
|
MD5 | d87b79b470fd0238c53356d1a4547097 |
|
BLAKE2b-256 | d765f2593ba1b87ff3c7120579915efbe757501d2a836a49f89aec233f82758c |
Hashes for bitcoin_explorer-1.2.13-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af2df3db0b44050991518be0da85551e850c20b3feb2994aa81058af2d1a6e54 |
|
MD5 | 6e84c2ea7abaa8b3bbab4d5cd56ee46b |
|
BLAKE2b-256 | bae1b73569320227397a810cec2afa317e8b2719cc92dc52b957f406ba16d186 |
Hashes for bitcoin_explorer-1.2.13-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae74b6dbfd0e5d72b401c9ccf1bcfb76cca3cdd69e3c2a75ed0e867bae4c807 |
|
MD5 | 1acb9a49c0bc9079c4359353e014d7a1 |
|
BLAKE2b-256 | a3e8479fb24223ff6124cd46f22e04934472fd67bcd6eadb643fe4bb3ebad07d |
Hashes for bitcoin_explorer-1.2.13-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | add6e7b8018b60f239e1302a04c6a46243b4187eff24f06588292b44461d7037 |
|
MD5 | 26d34bf880b01cbc6c8f82b5aaa7d6eb |
|
BLAKE2b-256 | 9424c70d594537e67ac14c8bde2eb91d7223185e7033266fcad0eb3aca9a1fa9 |
Hashes for bitcoin_explorer-1.2.13-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c9c1e57387b09e8af9db021ace7b77608f5177bebda80533d237e88a92c237 |
|
MD5 | 45d7dc50844fad0f7a1a63dc8eb0211a |
|
BLAKE2b-256 | 92b007d3b5280c9d789cc5d202536f55c8f0ecc529a36777be16bb170f67e109 |
Hashes for bitcoin_explorer-1.2.13-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9286e70bb57baa0938f0bdc0631ea6249d30d99e711458a2fd836055ccc89ff |
|
MD5 | 6dc17c4bf231fee493625cecc99a061c |
|
BLAKE2b-256 | 8ed61b55bd83708a09643370080cc52598f0ea1f1dcf0e794014cc7c066da5b5 |
Hashes for bitcoin_explorer-1.2.13-cp36-cp36m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7f0128ac65b132f6f2fcf9250547c1bd9008821c20a05fca304ffa942fd875 |
|
MD5 | b975ebb0de6023f80e029eecb6310f5f |
|
BLAKE2b-256 | 93a3a9a4ec5ccd3ea3ccfa4cb8ec9e7b1f27fe12c7a80c85c80908b881379498 |