A comprehensive Bitcoin blockchain data processor that mimics the complete functionality of the Esplora API. This Substream processes Bitcoin blocks and extracts all the data that Esplora provides through its REST API.
This Substream captures and processes all data types available through the Esplora API:
The Substream stores processed data in FoundationalStore for efficient querying:
block:*
- Block informationtx:*
- Transaction dataaddress:*
- Address informationmempool:*
- Mempool datanetwork:*
- Network statisticsfee_estimate:*
- Fee estimates// Get block information
let block_hash = store.get_last("block:hash");
let block_height = store.get_last("block:height");
// Get transaction data
let tx_fee = store.get_last("tx:0:fee");
let tx_size = store.get_last("tx:0:size");
// Get address information
let address_balance = store.get_last("address:0:balance");
let address_type = store.get_last("address:0:type");
// Get mempool data
let mempool_count = store.get_last("mempool:count");
let mempool_vsize = store.get_last("mempool:vsize");
// Get network statistics
let total_tx_count = store.get_last("network:total_tx_count");
let avg_fee_rate = store.get_last("network:avg_fee_rate");
// Get fee estimates
let fee_1_block = store.get_last("fee_estimate:1");
let fee_6_blocks = store.get_last("fee_estimate:6");
# Build the project
cargo build --release --target wasm32-unknown-unknown
# Package the Substream
substreams pack
# Run with console output
substreams run map_esplora_data --start-block 800000
# Run with GUI
substreams gui map_esplora_data --start-block 800000
# Get package information
substreams info
# Set up FoundationalStore endpoint
export SUBSTREAMS_API_TOKEN=your_token_here
# Run with FoundationalStore integration
substreams run map_esplora_data --start-block 800000 --store-module store_esplora_data
The main data structure containing all processed Bitcoin data:
BlockInfo
- Complete block informationTransactionInfo[]
- All transaction dataAddressInfo[]
- Address information and statisticsMempoolInfo
- Mempool data and statisticsNetworkStats
- Network statisticsFeeEstimate[]
- Fee estimates for different targetsAssetInfo[]
- Asset information (Liquid/Elements)Esplora API Endpoint | Substream Data | Storage Key |
---|---|---|
GET /block/:hash |
BlockInfo |
block:* |
GET /tx/:txid |
TransactionInfo |
tx:* |
GET /address/:address |
AddressInfo |
address:* |
GET /mempool |
MempoolInfo |
mempool:* |
GET /fee-estimates |
FeeEstimate[] |
fee_estimate:* |
GET /blocks/tip/hash |
NetworkStats.tip_hash |
network:tip_hash |
proto/esplora.proto
src/main.rs
# Run with test data
substreams run map_esplora_data --start-block 800000 --stop-block 800010
# Validate output
substreams run map_esplora_data --start-block 800000 --output json | jq .
MIT License - see LICENSE file for details.
For questions and support, please open an issue on GitHub.
substreams gui bitcoin-esplora-complete@v0.1.0 map_esplora_complete_data