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.

The Mempool backend is configured through the mempool-config.json file located in the backend directory. This file controls all aspects of the backend’s behavior, from Bitcoin Core RPC connections to database settings and caching strategies.

Configuration File Location

By default, the backend looks for mempool-config.json in the backend directory. You can specify a custom location using the MEMPOOL_CONFIG_FILE environment variable:
MEMPOOL_CONFIG_FILE=/path/to/mempool-config.json npm run start
All configuration options can be overridden with environment variables when using Docker. See the Docker README for details on environment variable naming conventions.

Core Configuration Sections

Main Application Settings

The MEMPOOL section controls the core behavior of the Mempool application.
ParameterTypeDefaultDescription
NETWORKstringmainnetBitcoin network: mainnet, testnet, testnet4, signet, liquid, liquidtestnet, or regtest
BACKENDstringnoneElectrum backend type: electrum, esplora, or none
ENABLEDbooleantrueEnable/disable the Mempool application
HTTP_PORTnumber8999HTTP port for the backend API
UNIX_SOCKET_PATHstring""Unix socket path (alternative to HTTP port)
SPAWN_CLUSTER_PROCSnumber0Number of cluster processes to spawn (0 = disabled)
API_URL_PREFIXstring/api/v1/API URL prefix
POLL_RATE_MSnumber2000Mempool polling interval in milliseconds
ParameterTypeDefaultDescription
CACHE_DIRstring./cacheDirectory for caching data
CACHE_ENABLEDbooleantrueEnable/disable caching
CLEAR_PROTECTION_MINUTESnumber20Minutes to protect cache from clearing
RECOMMENDED_FEE_PERCENTILEnumber50Percentile for recommended fee calculation
BLOCK_WEIGHT_UNITSnumber4000000Maximum block weight in weight units
INITIAL_BLOCKS_AMOUNTnumber8Number of initial blocks to load
MEMPOOL_BLOCKS_AMOUNTnumber8Number of mempool blocks to display
INDEXING_BLOCKS_AMOUNTnumber11000Blocks to index (0 = disable, -1 = all blocks)
BLOCKS_SUMMARIES_INDEXINGbooleanfalseEnable block summaries indexing
GOGGLES_INDEXINGbooleanfalseEnable goggles indexing
USE_SECOND_NODE_FOR_MINFEEbooleanfalseUse second Bitcoin Core node for min fee
EXTERNAL_ASSETSarray[]External asset configurations
EXTERNAL_MAX_RETRYnumber1Maximum retries for external requests
EXTERNAL_RETRY_INTERVALnumber0Retry interval in milliseconds
USER_AGENTstringmempoolUser agent for external requests
STDOUT_LOG_MIN_PRIORITYstringdebugMinimum log priority: emerg, alert, crit, err, warn, notice, info, or debug
AUTOMATIC_POOLS_UPDATEbooleanfalseAutomatically update mining pools data
POOLS_JSON_URLstringGitHub URLURL for mining pools JSON data
POOLS_JSON_TREE_URLstringGitHub API URLURL for mining pools tree data
POOLS_UPDATE_DELAYnumber604800Mining pools update delay in seconds (default: 1 week)
AUDITbooleanfalseEnable block audit functionality
RUST_GBTbooleantrueUse Rust implementation for GetBlockTemplate
LIMIT_GBTbooleanfalseLimit GetBlockTemplate results
CPFP_INDEXINGbooleanfalseEnable Child Pays For Parent indexing
MAX_BLOCKS_BULK_QUERYnumber0Maximum blocks per bulk query (0 = unlimited)
DISK_CACHE_BLOCK_INTERVALnumber6Block interval for disk caching
MAX_PUSH_TX_SIZE_WEIGHTnumber400000Maximum transaction size for push in weight units
ALLOW_UNREACHABLEbooleantrueAllow connections to unreachable nodes
PRICE_UPDATES_PER_HOURnumber1Bitcoin price updates per hour
MAX_TRACKED_ADDRESSESnumber1Maximum number of tracked addresses
Setting INDEXING_BLOCKS_AMOUNT to -1 will index all blocks, which requires significant storage and processing time. Use with caution.
Example Configuration:
{
  "MEMPOOL": {
    "NETWORK": "mainnet",
    "BACKEND": "electrum",
    "ENABLED": true,
    "HTTP_PORT": 8999,
    "SPAWN_CLUSTER_PROCS": 0,
    "API_URL_PREFIX": "/api/v1/",
    "POLL_RATE_MS": 2000,
    "CACHE_DIR": "./cache",
    "RECOMMENDED_FEE_PERCENTILE": 50,
    "INDEXING_BLOCKS_AMOUNT": 11000,
    "CPFP_INDEXING": false
  }
}

Advanced Configuration Sections

Configure external data servers for additional blockchain data.
ParameterTypeDefaultDescription
MEMPOOL_APIstringhttps://mempool.space/api/v1External Mempool API endpoint
MEMPOOL_ONIONstringOnion addressExternal Mempool API Tor onion address
LIQUID_APIstringhttps://liquid.network/api/v1External Liquid API endpoint
LIQUID_ONIONstringOnion addressExternal Liquid API Tor onion address
Example:
{
  "EXTERNAL_DATA_SERVER": {
    "MEMPOOL_API": "https://mempool.space/api/v1",
    "MEMPOOL_ONION": "http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/api/v1"
  }
}
Configure MaxMind GeoIP databases for geolocation features.
ParameterTypeDefaultDescription
ENABLEDbooleanfalseEnable MaxMind geolocation
GEOLITE2_CITYstringPathPath to GeoLite2-City.mmdb database
GEOLITE2_ASNstringPathPath to GeoLite2-ASN.mmdb database
GEOIP2_ISPstringPathPath to GeoIP2-ISP.mmdb database
Example:
{
  "MAXMIND": {
    "ENABLED": true,
    "GEOLITE2_CITY": "/usr/local/share/GeoIP/GeoLite2-City.mmdb",
    "GEOLITE2_ASN": "/usr/local/share/GeoIP/GeoLite2-ASN.mmdb",
    "GEOIP2_ISP": "/usr/local/share/GeoIP/GeoIP2-ISP.mmdb"
  }
}
You need to download MaxMind databases separately. Visit MaxMind’s website to obtain the database files.
Configure data replication from other Mempool instances.
ParameterTypeDefaultDescription
ENABLEDbooleanfalseEnable data replication
AUDITbooleanfalseReplicate audit data
AUDIT_START_HEIGHTnumber774000Block height to start audit replication
STATISTICSbooleanfalseReplicate statistics data
STATISTICS_START_TIMEnumber/string1481932800Unix timestamp to start statistics replication
SERVERSarray[]Array of replication server URLs
Example:
{
  "REPLICATION": {
    "ENABLED": true,
    "AUDIT": true,
    "AUDIT_START_HEIGHT": 774000,
    "STATISTICS": true,
    "SERVERS": [
      "https://mempool.space",
      "https://mempool.ninja"
    ]
  }
}
Configure integration with Mempool Services API.
ParameterTypeDefaultDescription
APIstring""Mempool Services API endpoint
ACCELERATIONSbooleanfalseEnable transaction acceleration feature
Example:
{
  "MEMPOOL_SERVICES": {
    "API": "https://api.mempool.services",
    "ACCELERATIONS": true
  }
}
Configure Redis for high-performance caching.
ParameterTypeDefaultDescription
ENABLEDbooleanfalseEnable Redis caching
UNIX_SOCKET_PATHstring""Unix socket path for Redis connection
BATCH_QUERY_BASE_SIZEnumber5000Base size for batch queries
Example:
{
  "REDIS": {
    "ENABLED": true,
    "UNIX_SOCKET_PATH": "/var/run/redis/redis.sock",
    "BATCH_QUERY_BASE_SIZE": 5000
  }
}
Configure fiat currency price tracking.
ParameterTypeDefaultDescription
ENABLEDbooleantrueEnable fiat price tracking
PAIDbooleanfalseUse paid API tier
API_KEYstring""API key for paid tier
Example:
{
  "FIAT_PRICE": {
    "ENABLED": true,
    "PAID": false,
    "API_KEY": ""
  }
}
Configure wallet address tracking features.
ParameterTypeDefaultDescription
ENABLEDbooleanfalseEnable wallet tracking
AUTObooleanfalseAutomatically discover wallets
WALLETSarray[]Array of wallet addresses to track
Example:
{
  "WALLETS": {
    "ENABLED": true,
    "AUTO": false,
    "WALLETS": [
      "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
    ]
  }
}
Configure Stratum mining protocol integration.
ParameterTypeDefaultDescription
ENABLEDbooleanfalseEnable Stratum integration
APIstringhttp://localhost:1234Stratum API endpoint
Example:
{
  "STRATUM": {
    "ENABLED": true,
    "API": "http://localhost:1234"
  }
}

Configuration Best Practices

Start Simple

Begin with minimal configuration and enable features as needed. Most defaults are suitable for typical deployments.

Enable Indexing

Set INDEXING_BLOCKS_AMOUNT to enable historical block data. This improves user experience but requires more storage.

Monitor Logs

Configure appropriate STDOUT_LOG_MIN_PRIORITY levels. Use info for production, debug for development.

Secure RPC

Always use strong credentials for Bitcoin Core RPC and database connections. Never use default passwords in production.

Environment Variables Override (Docker)

When using Docker, configuration options can be overridden with environment variables using the following pattern:
  • Nested JSON keys are joined with underscores
  • Section names are uppercased
  • Example: MEMPOOL.NETWORKMEMPOOL_NETWORK
api:
  environment:
    MEMPOOL_NETWORK: "mainnet"
    MEMPOOL_BACKEND: "electrum"
    MEMPOOL_HTTP_PORT: "8999"
    MEMPOOL_INDEXING_BLOCKS_AMOUNT: "11000"
    MEMPOOL_CPFP_INDEXING: "true"
For a complete list of environment variable overrides, see the Docker README.

Next Steps

Bitcoin Core Setup

Configure Bitcoin Core RPC connection

Database Setup

Set up and configure MariaDB

Electrum Server

Connect an Electrum server for address lookups

Frontend Config

Configure the frontend application

Build docs developers (and LLMs) love