Mempool docker cannot connect to Electrum server.
I’m having trouble “connecting” mempool.space to the lectrumX server. My Bitcoin Core is working fine, and the lectrumX server is fine as well, even the chain tips. I installed docker and docker-compose. Everything works fine, but when I try docker-compose up
I think it’s running fine, but eventually I get this error and it keeps repeating itself.
docker-api-1 | Jan 6 11:38:12 (98) ERR: Electrum error: “errno”:-111,”code”:”ECONNREFUSED”,”syscall”:”connect”,”address”:”0.0.0.0″,” port”:50001 docker-api-1 | Jan 6 11:38:12 (98) Info: Disconnected from Electrum server at 0.0.0.0:50001.
My docker-compose.yml file:
version: "3.7"
services:
web:
environment:
FRONTEND_HTTP_PORT: "8080"
BACKEND_MAINNET_HTTP_HOST: "api"
image: mempool/frontend:latest
user: "1000:1000"
restart: always
stop_grace_period: 1m
command: "./wait-for db:3306 --timeout=720 -- nginx -g 'daemon off;'"
ports:
- 4080:8080
api:
environment:
ELECTRUM_HOST: "0.0.0.0"
ELECTRUM_PORT: "50001"
ELECTRUM_TLS_ENABLED: "true"
MEMPOOL_BACKEND: "electrum"
CORE_RPC_HOST: "0.0.0.0"
CORE_RPC_PORT: "8332"
CORE_RPC_USERNAME: "####"
CORE_RPC_PASSWORD: "####"
DATABASE_ENABLED: "true"
DATABASE_HOST: "db"
DATABASE_DATABASE: "mempool"
DATABASE_USERNAME: "mempool"
DATABASE_PASSWORD: "mempool"
STATISTICS_ENABLED: "true"
image: mempool/backend:latest
user: "1000:1000"
restart: always
stop_grace_period: 1m
command: "./wait-for-it.sh db:3306 --timeout=720 --strict -- ./start.sh"
volumes:
- ./data:/backend/cache
db:
environment:
MYSQL_DATABASE: "mempool"
MYSQL_USER: "mempool"
MYSQL_PASSWORD: "mempool"
MYSQL_ROOT_PASSWORD: "admin"
image: mariadb:10.5.8
user: "1000:1000"
restart: always
stop_grace_period: 1m
volumes:
- ./mysql/data:/var/lib/mysql
My lectrumX.conf file:
# default /etc/electrumx.conf for systemd
# REQUIRED
DB_DIRECTORY = /home/qbr1ck/electrumx_db
# Bitcoin Node RPC Credentials
DAEMON_URL = ####:####@localhost
COIN = Bitcoin
SERVICES = tcp://0.0.0.0:50001
PEER_DISCOVERY = off
COST_SOFT_LIMIT = 0
COST_HARD_LIMIT = 0
Users and passwords are hashed in both files, but are identical.
This is the full output after running docker, it may give you some clues.
(+) Run 3/3 ⠿ Run container docker-db-1 0.0 seconds ⠿ Run container docker-web-1 0.0 seconds ⠿ Recreate container docker-api-1 60.4s docker-api-1, connect to docker-db-1 , docker-web-1 docker-api-1 | wait-for-it.sh: db:3306 docker-api-1 | Waiting for 720 seconds wait-for-it.sh: db:3306 will be available in 0 seconds docker-db-1 | 2023-01-08 13:49:36 6 (Warning) Aborted connection 6 – db: ‘unconnected’ user: ‘unauthenticated’ host: ‘172.16.57.2’ (This connection was terminated gracefully without authentication.) docker-api -1 | Jan 8 13:49:37 (97) Notice: Starting Mempool server… (a210a3f) docker-api-1 | Jan 8 13:49:37 (97) INFO: Restoring memory pool and blocking data from disk cache docker-api-1 | Jan 8 13:49:37 (97) Error: Electrum error: “errno”:-111,”code”:”ECONNREFUSED”,”syscall”:”connect”,”address”:”127.0.0.1″,” port”:50001 docker-api-1 | Jan 8 13:49:37 (97) ERR: localhost:50001 Error connecting to Electrum server on docker-api-1. Jan 8 13:49:37 (97) Info: Lost connection to Electrum server at localhost:50001 docker-api-1 | Jan 8 13:49:37 (97) Info: Database connection established. docker-api-1 | Jan 8 13:49:37 (97) INFO: Starting statistics service docker-api-1 | Jan 8 13:49:37 (97) Info: Exchange rate service started docker-api-1 | Jan 8 13:49:37 (97) Info: The exchange rate service is queried over clearnet using https://price.bisq.wiz.biz/getAllMarketPrices docker-api-1 | Jan 8 13:49:37 (97) Notice: Mempool server is running on port 8999 docker-api-1 | Jan 8 13:49:37 (97) Info: Updated latest mining pools from https://raw.githubusercontent.com/mempool/mining-pools/master/pools.json via Clearnet docker-api-1 | Jan 8 13:49:42 (97) WARNING: runMainLoop error: ECONNREFUSED Connect 127.0.0.1:8332. Try again in 10 seconds. docker-api-1 | Jan 8 13:49:47 (97) Error: Electrum error: “errno”:-111,”code”:”ECONNREFUSED”,”syscall”:”connect”,”address”:”127.0.0.1″,” port”:50001 docker-api-1 | Jan 8 13:49:47 (97) Error: Electrum error: “errno”:-111,”code”:”ECONNREFUSED”,”syscall”:”connect”,”address”:”127.0.0.1″,” port”:50001 docker-api-1 | Jan 8 13:49:47 (97) Info: Lost connection to Electrum server at localhost:50001 docker-api-1 | Jan 8 13:49:52 (97) WARNING: runMainLoop error: ECONNREFUSED Connect 127.0.0.1:8332. Try again in 20 seconds. docker-api-1 | Jan 8 13:49:57 (97) Error: Electrum error: “errno”:-111,”code”:”ECONNREFUSED”,”syscall”:”connect”,”address”:”127.0.0.1″,” port”:50001 docker-api-1 | Jan 8 13:49:57 (97) ERR: Electrum error: “errno”:-111,”code”:”ECONNREFUSED”,”syscall”:”connect”,”address”:”127.0.0.1″,” port”:50001 docker-api-1 | Jan 8 13:49:57 (97) Info: Lost connection to Electrum server on localhost:50001.