Prerequisites.
Introduction #
The Mempool Visual Explorer is a valuable tool for looking up detailed information about blocks, addresses, balances & transactions.
Hosting your instance locally is preferable to entering personal transaction details into websites you don’t control.
Install Docker #
Before installing Mempool, Docker is required.
Add Docker’s official GPG key.
sudo apt update
sudo apt install ca-certificates gnupg -y
sudo install -m 0755 -d /etc/apt/keyrings
torsocks curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Add the Docker repository to Apt sources.
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
Install the Docker packages.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Add the user to the docker group.
sudo usermod -aG docker satoshi
Log out.
exit
Log back in as “satoshi” again. This re-evaluates the user’s new membership to the Docker group.
Install Mempool #
Clone the Mempool repository.
git clone https://github.com/mempool/mempool.git
Enter the Mempool Docker directory.
cd mempool/docker
Open the “docker-compose.yml” file.
nano docker-compose.yml
Edit the following lines.
####change
ports:
- 80:8080
##to
ports:
- 4080:8080
####change
MEMPOOL_BACKEND: "none"
##to
MEMPOOL_BACKEND: "electrum"
####edit to your nodes local ip
CORE_RPC_HOST: "172.27.0.1"
####edit to your core rpc username & password
CORE_RPC_USERNAME: "mempool"
CORE_RPC_PASSWORD: "mempool"
####change all 3 instances of
restart: on-failure
##to
restart: always
Add the following lines below “STATISTICS_ENABLED,” editing “ELECTRUM_HOST” to include the node’s local IP.
ELECTRUM_HOST: "192.xxx.x.xx"
ELECTRUM_PORT: "50002"
ELECTRUM_TLS_ENABLED: "true"
Paste the following block at the bottom of the file on the next available free line. Ensure the spacing is exactly as shown.
networks:
default:
driver: bridge
ipam:
config:
- subnet: 172.16.57.0/24
Save and exit the file.
Now, initialize Mempool.
docker compose up -d
Open a web browser, and in the address bar, type your node’s IP address, followed by “:4080” to visit the local Mempool instance.
As a fresh install, it may take time before Mempool fully populates, so don’t be concerned if the dashboard is incomplete.
Tor Connections #
A Tor Browser can access The local Mempool installation from anywhere worldwide. A unique onion address is required for this functionality.
Open the “torrc” file.
sudo nano /etc/tor/torrc
Add the following lines to the bottom of the file, then save and exit.
# Hidden Service Mempool
HiddenServiceDir /var/lib/tor/mempool/
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:4080
Restart the Tor service.
sudo systemctl restart tor
Mempool’s Tor address can be requested with the following command.
sudo cat /var/lib/tor/mempool/hostname