A lightweight Bitcoin mempool API service that provides compatible endpoints with mempool.space and blockstream.info. This service connects to your local Bitcoin node and exposes a REST API for accessing blockchain data and fee estimates.
GET /api/blocks/tip/height- Get current block heightGET /api/block-height/:height- Get block hash by heightGET /api/block/:hash/raw- Get raw block data by hash
GET /api/fee-estimates- Get fee estimates for various confirmation targets (1-1008 blocks)
- Rust toolchain (if building from source)
- Bitcoin Core node with RPC access
- Nix (optional, for using flake-based builds)
The service can be configured using environment variables or command line arguments:
BITCOIN_RPC_URL: Bitcoin RPC URLBITCOIN_RPC_USER: Bitcoin RPC usernameBITCOIN_RPC_PASS: Bitcoin RPC passwordBIND_ADDR: Bind address for the HTTP server (default: 127.0.0.1:3000)
Usage: minipool [OPTIONS] --bitcoin-rpc-url <BITCOIN_RPC_URL> --bitcoin-rpc-user <BITCOIN_RPC_USER> --bitcoin-rpc-pass <BITCOIN_RPC_PASS>
Options:
--bitcoin-rpc-url <BITCOIN_RPC_URL>
Bitcoin RPC URL [env: BITCOIN_RPC_URL=]
--bitcoin-rpc-user <BITCOIN_RPC_USER>
Bitcoin RPC username [env: BITCOIN_RPC_USER=]
--bitcoin-rpc-pass <BITCOIN_RPC_PASS>
Bitcoin RPC password [env: BITCOIN_RPC_PASS=]
--bind-addr <BIND_ADDR>
Bind address for the HTTP server [env: BIND_ADDR=] [default: 127.0.0.1:3000]
-h, --help
Print help
-V, --version
Print version
nix developThis provides a complete development environment with all necessary tools.
cargo run
cargo test
cargo fmt
cargo clippyminipool includes a NixOS module for easy deployment. Add to your configuration (untested):
{services.minipool={enable=true;bindAddr="127.0.0.1:3000";bitcoinRpcUrl="http://localhost:8332";bitcoinRpcUser="rpcuser";bitcoinRpcPassFile="/path/to/rpc/password/file";};}If you are running nix-bitcoin this cofig snippet should work out of the box:
users.users.minipool.extraGroups=["bitcoinrpc-public"];services.minipool={enable=true;bitcoinRpcUrl="http://127.0.0.1:8332";bitcoinRpcUser="public";bitcoinRpcPassFile="/etc/nix-bitcoin-secrets/bitcoin-rpcpassword-public";};services.nginx={virtualHosts."minipool.example.com"={forceSSL=true;enableACME=true;locations."/"={proxyPass="http://127.0.0.1:3000";};};};This project is licensed under the MIT License - see the LICENSE file for details.