Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mempool/mempool/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through setting up a local development environment for Mempool. You can run just the frontend (proxied to production backend) or a complete stack with backend and frontend.

Quick Frontend Setup

If you want to quickly improve the UI, fix typos, or make other updates that don’t require backend changes, you can run the frontend locally and proxy to the mempool.space backend.
1

Clone the Repository

Get the latest Mempool code:
git clone https://github.com/mempool/mempool
cd mempool/frontend
Check out the latest release:
latestrelease=$(curl -s https://api.github.com/repos/mempool/mempool/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
git checkout $latestrelease
2

Configure the Site

The same frontend codebase is used for both mempool.space and liquid.network.Configure for your target site:
npm run config:defaults:mempool
3

Install Dependencies

Ensure you have Node.js 20.x and npm 9.x or newer installed.
npm install
4

Start the Development Server

Run the frontend with production backend proxy:
npm run serve:local-prod
The frontend will be available at http://localhost:4200/ with all API requests proxied to https://mempool.space.

Full Stack Setup

For backend development or running a complete local instance, follow these steps to set up both backend and frontend.
These instructions are intended for developers. For production deployments, see the installation methods in the main README.

Backend Setup

1

Clone the Repository

git clone https://github.com/mempool/mempool
cd mempool
Checkout the latest release:
latestrelease=$(curl -s https://api.github.com/repos/mempool/mempool/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
git checkout $latestrelease
2

Configure Bitcoin Core

Enable txindex, RPC, and set credentials in bitcoin.conf:
txindex=1
server=1
rpcuser=mempool
rpcpassword=mempool
Restart Bitcoin Core after making these changes.
3

Configure Electrum Server (Optional)

Pick an Electrum Server implementation, configure it, and ensure it’s synced.
You can run Mempool without an Electrum Server, but address lookups will be disabled.
Supported implementations:
4

Set Up MariaDB

Mempool requires MariaDB v10.5 or later. If you have MySQL installed, migrate any existing databases before installing MariaDB.
Install MariaDB:
apt-get install mariadb-server mariadb-client
Create database and grant privileges:
MariaDB [(none)]> create database mempool;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on mempool.* to 'mempool'@'%' identified by 'mempool';
Query OK, 0 rows affected (0.00 sec)
5

Build the Backend

  • Node.js 20.x and npm 9.x or newer required
  • Rust must be installed
cd backend
npm install --no-install-links
npm run build
6

Configure the Backend

Create your configuration file:
cp mempool-config.sample.json mempool-config.json
Edit mempool-config.json to set:
  • Bitcoin Core RPC credentials in CORE_RPC section
  • Electrum backend type in MEMPOOL.BACKEND:
    • "electrum" for romanz/electrs or Fulcrum
    • "esplora" for mempool/electrs
    • "none" if not using Electrum
7

Start the Backend

Run the Mempool backend:
npm run start
To specify a custom config file location:
MEMPOOL_CONFIG_FILE=/path/to/mempool-config.json npm run start
When running successfully, you should see output like:
Mempool updated in 0.189 seconds
Updating mempool
Calculated fee for transaction 1 / 10
Calculated fee for transaction 2 / 10
...

Frontend Setup

1

Install Dependencies

With the backend running, navigate to the frontend directory:
cd ../frontend
npm install
2

Build the Frontend

For production build:
npm run build
For development with hot reload:
npm run serve
The frontend will connect to your local backend at http://localhost:4200/.

Development Workflows

Backend Development with Watchers

The backend is static TypeScript compiled to the dist folder. To avoid manual shutdown/recompile/restart cycles, set up watchers:
1

Install Tools

npm install -g ts-node nodemon
2

Run Watcher

cd backend
nodemon src/index.ts --ignore cache/
nodemon should be in npm’s global binary folder. Find it with npm -g bin if needed.

Frontend Development Variants

The frontend can run in different modes:
Connect to your local backend:
npm run serve

Regtest Development

Useful for testing without mainnet data.
bitcoind -regtest
# Create wallet
bitcoin-cli -regtest createwallet test

# Load wallet
bitcoin-cli -regtest loadwallet test
# Get new address
address=$(bitcoin-cli -regtest getnewaddress)

# Mine 101 blocks (needed before spending)
bitcoin-cli -regtest generatetoaddress 101 $address
# Send 0.1 BTC at 5 sat/vB
bitcoin-cli -named -regtest sendtoaddress \
  address=$(bitcoin-cli -regtest getnewaddress) \
  amount=0.1 \
  fee_rate=5
Generate blocks at regular intervals:
# Every 10 seconds
watch -n 10 "bitcoin-cli -regtest generatetoaddress 1 $address"

Advanced Configuration

Mining Pools Update

By default, mining pools are not automatically updated. To manually update:
npm run start --update-pools
This triggers mining pool updates and re-indexes appropriate blocks. To enable automatic updates, set in mempool-config.json:
{
  "MEMPOOL": {
    "AUTOMATIC_POOLS_UPDATE": true
  }
}

Re-index Tables

Manually force re-indexing of specific tables:
npm run start --reindex=blocks,hashrates
A 5-second delay is observed before truncating tables to prevent accidental data loss.

Next Steps

Architecture

Learn about Mempool’s system architecture

Testing

Run tests and ensure code quality

Contributing

Submit your first contribution

API Documentation

Explore the Mempool API

Build docs developers (and LLMs) love