Intro
Mempool is a real-time web interface for visualizing Bitcoin’s mempool, where unconfirmed transactions are stored. It provides detailed insights into transaction fees, mempool congestion, and network activity. Users can view transaction history, fee estimates, and the current state of the Bitcoin network.
Self-hosting a mempool site alongside a Bitcoin node enhances your privacy by keeping transaction data within your control and not relying on third-party servers.
Additionally, operating your own instance eliminates dependency on external services, ensuring continuous access and reliability even if external servers experience issues or downtime.
Prerequisite
Before we start, ensure you have the following prerequisites:
- A server or machine with Docker installed.
- Basic understanding of Docker concepts such as containers, images, and volumes.
- Docker Compose.
- A Bitcoin node with an Electrum server, see 15-zero-to-bitcoin-node to see how to install both.
- A Caddy server, see 01-caddy-in-docker or 09-caddy-wildcard-certificates
Configuration
Networking
Assuming you have followed the previous guide 15-zero-to-bitcoin-node and want to use a Caddy reverse proxy (see 01-caddy-in-docker or 09-caddy-wildcard-certificates) to access the Mempool web server, the network configuration should be as follows:
The mempool-api
service is on the bitcoin
network to access both Elects and Bitcoin node and in the internal
network to access the mempool-db
service.
The mempool-web
is on the caddy
network to allow Caddy to reverse proxy to the server, and on the internal
network to access the mempool-api
backend.
The mempool-db
only needs access to the mempool-api
and mempool-web
, so it is configured to use only the internal
network.
Docker compose file
Create a folder mempool
:
Create a docker-compose.yml
file with the content:
Note
Be sure to replace
bitcoin_rpc_user
andbitcoin_rpc_password
with your actual credentials.
Start the service using the command:
Caddy reverse proxy
Add the Caddy configuration:
or if you are using wildcard certificates as described in the 09-caddy-wildcard-certificates guide:
Restart Caddy and visit the URL mempool.domain.name
. You should see your Mempool site initializing and loading.
Conclusion
With Caddy handling the reverse proxy, and the appropriate access set up for mempool-api
, mempool-web
, and mempool-db
, your Mempool instance should initialize smoothly, allowing you to securely and privately access all the blockchain informations through your local node, without relying on other services.
Resources
- Mempool Github: https://github.com/mempool/mempool