Inputs
sf.substreams.v1.Clocksf.bitcoin.v1.Block

Package ref
bitcoin-esplora-enhanced@v0.2.1Run package
CLI
Run map_block_esplora from the command line.
substreams run bitcoin-esplora-enhanced@v0.2.1 map_block_esplora -e bitcoin --start-block -1substreams auth or directly on thegraph.market (see docs).README
Enhanced Bitcoin blockchain data processor providing Esplora API compatible output using Substreams.
| Module | Output | Description |
|---|---|---|
map_block_esplora | BlockEsplora | Block metadata in Esplora format |
map_transactions_esplora | TransactionsEsplora | All transactions with inputs/outputs/witness |
map_addresses_esplora | AddressesEsplora | Address analysis and UTXO tracking |
map_network_stats | NetworkStats | Network statistics and fee estimates |
# Install Substreams CLI
brew install streamingfast/tap/substreams
# Authenticate
substreams auth
# Stream block data
substreams run -e btc.substreams.pinax.network:443 \
https://github.com/PaulieB14/Bitcoin-Explorer-Substream/releases/download/v0.2.0/bitcoin-esplora-enhanced-v0.2.0.spkg \
map_block_esplora -s 800000 -t +10
# Stream transactions
substreams run -e btc.substreams.pinax.network:443 \
https://github.com/PaulieB14/Bitcoin-Explorer-Substream/releases/download/v0.2.0/bitcoin-esplora-enhanced-v0.2.0.spkg \
map_transactions_esplora -s 800000 -t +10
git clone https://github.com/PaulieB14/Bitcoin-Explorer-Substream.git
cd Bitcoin-Explorer-Substream
make build
make pack
# Setup database
substreams-sink-sql setup \
"psql://user:pass@localhost:5432/bitcoin" \
./sql/schema-postgres.sql
# Run sink
substreams-sink-sql run \
"psql://user:pass@localhost:5432/bitcoin" \
bitcoin-esplora-enhanced-v0.2.0.spkg \
map_block_esplora
# Setup database
substreams-sink-sql setup \
"clickhouse://user:pass@localhost:9000/bitcoin" \
./sql/schema-clickhouse.sql
# Run sink
substreams-sink-sql run \
"clickhouse://user:pass@localhost:9000/bitcoin" \
bitcoin-esplora-enhanced-v0.2.0.spkg \
map_block_esplora
{
"id": "00000000000000000002a7c4c1e48d76c5a37902165a270156b7a8d72728a054",
"height": 800000,
"version": 536870912,
"timestamp": 1690168629,
"tx_count": 3721,
"size": 1621583,
"weight": 3993561,
"merkle_root": "...",
"previous_hash": "...",
"difficulty": 53911173001054.59
}
{
"txid": "abc123...",
"version": 2,
"locktime": 0,
"size": 225,
"weight": 573,
"fee": 4500,
"inputs": [...],
"outputs": [...],
"witness": ["304402...", "0279be..."],
"status": {
"confirmed": true,
"block_height": 800000
}
}
# Check code
make check
# Format code
make fmt
# Run tests
make test-unit
# Clean build
make clean
Apache 2.0
Modules
Inputs
Inputs
Inputs
Inputs