Skip to content

Instantly share code, notes, and snippets.

@tenequm
Last active September 19, 2024 06:37
Show Gist options
  • Save tenequm/61b264ba79c5d34816b53d36a479df59 to your computer and use it in GitHub Desktop.
Save tenequm/61b264ba79c5d34816b53d36a479df59 to your computer and use it in GitHub Desktop.
A Docker Compose config for Fractal Bitcoin with `bitcoind`, `ord`, `mempool`, `fulcrum`, `cat20-tracker` nodes
services:
bitcoind:
image: fractalbitcoin/fractal:v0.2.1
restart: always
entrypoint: ["bitcoind", "-datadir=/data/"]
configs: [{ source: bitcoinconf, target: /data/bitcoin.conf }]
ports:
- "8330:8330"
- "8331:8331"
- "8332:8332"
- "8333:8333"
- '8433:8433' # zmqpubhashblock for Fulcrum
volumes:
- ./data/bitcoind:/data
ord:
# Ref: https://github.com/fractal-bitcoin/ord/releases/tag/v0.20.0-f1
image: tenequm/ord-fractal:v0.20.0-f1
restart: unless-stopped
stop_grace_period: 15m30s
depends_on: [bitcoind]
entrypoint: /usr/local/bin/ord
command: --chain=fractal-mainnet server --http-port=8080
volumes:
- ./data/ord:/index-data
- ./data/bitcoind:/data/.bitcoin
environment:
ORD_BITCOIN_DATA_DIR: /data/.bitcoin
ORD_BITCOIN_RPC_URL: 'bitcoind:8332'
ORD_BITCOIN_RPC_USERNAME: ${RPC_USER:-bitcoin}
ORD_BITCOIN_RPC_PASSWORD: ${RPC_PASSWORD:-opcatAwesome}
ORD_BITCOIN_RPC_LIMIT: '24'
ORD_DATA_DIR: /index-data
ORD_INDEX_RUNES: '1'
ORD_INDEX_SATS: '1'
ORD_INDEX_SPENT_SATS: '1'
ORD_INDEX_TRANSACTIONS: '1'
ORD_INDEX_ADDRESSES: '1'
# RUST_LOG: debug
ports: ['8080:8080']
fulcrum:
depends_on: [bitcoind]
restart: unless-stopped
image: cculianu/fulcrum:v1.11.0
stop_grace_period: 15m30s
# Reference: https://github.com/cculianu/Fulcrum/blob/master/doc/fulcrum-quick-config.conf
command:
- Fulcrum
- --bitcoind=bitcoind:8332
- --rpcuser=${RPC_USER:-bitcoin}
- --rpcpassword=${RPC_PASSWORD:-opcatAwesome}
- --tcp=0.0.0.0:50001
- --ws=0.0.0.0:50003
- --admin=0.0.0.0:8000
- --stats=0.0.0.0:8001
- --polltime=2.0
- --bd-clients=2
- --utxo-cache=512
- _ENV_
environment:
- DATA_DIR=/data
- DB_MAX_OPEN_FILES=20
volumes:
- ./data/fulcrum:/data
ports:
- 50001:50001
- 50003:50003 # websocket
- 58000:8000 # admin
- 58001:8001 # stats
mempool-web:
image: mempool/frontend:v3.0.0
environment:
FRONTEND_HTTP_PORT: '8080'
BACKEND_MAINNET_HTTP_HOST: 'mempool-api'
user: '1000:1000'
restart: unless-stopped
stop_grace_period: 1m
command: "./wait-for mempool-db:3306 --timeout=720 -- nginx -g 'daemon off;'"
ports: [8000:8080]
mempool-api:
image: mempool/backend:v3.0.0
# Reference: https://github.com/mempool/mempool/tree/master/docker
environment:
MEMPOOL_CACHE_DIR: /backend/cache
MEMPOOL_CPFP_INDEXING: 'true'
MEMPOOL_INDEXING_BLOCKS_AMOUNT: '100'
MEMPOOL_POLL_RATE_MS: '2000'
MEMPOOL_API_URL_PREFIX: '/api/v1/'
RECOMMENDED_FEE_PERCENTILE: '50'
ELECTRUM_HOST: 'fulcrum'
ELECTRUM_PORT: '50001'
ELECTRUM_TLS_ENABLED: 'false'
CORE_RPC_HOST: 'bitcoind'
CORE_RPC_PORT: '8332'
CORE_RPC_USERNAME: '${RPC_USER:-bitcoin}'
CORE_RPC_PASSWORD: '${RPC_PASSWORD:-opcatAwesome}'
DATABASE_ENABLED: 'true'
DATABASE_HOST: 'mempool-db'
DATABASE_DATABASE: 'mempool'
DATABASE_USERNAME: 'mempool'
DATABASE_PASSWORD: 'mempool'
STATISTICS_ENABLED: 'true'
user: '1000:1000'
restart: unless-stopped
stop_grace_period: 1m
command: './wait-for-it.sh mempool-db:3306 --timeout=720 --strict -- ./start.sh'
volumes:
- ./data/mempool-api:/backend/cache
mempool-db:
environment:
MYSQL_DATABASE: 'mempool'
MYSQL_USER: 'mempool'
MYSQL_PASSWORD: 'mempool'
MYSQL_ROOT_PASSWORD: 'admin'
image: mariadb:10.5.21
restart: unless-stopped
stop_grace_period: 1m
volumes:
- ./data/mempool-db:/var/lib/mysql
tracker:
image: tenequm/tracker-cat20-fractal:ffeedc0
restart: always
environment:
- DATABASE_HOST=postgres
- RPC_HOST=bitcoind
- RPC_USER=${RPC_USER:-bitcoin}
- RPC_PASSWORD=${RPC_PASSWORD:-opcatAwesome}
ports:
- "3000:3000"
# Needed for tracker
postgres:
image: postgres:16
restart: always
shm_size: 2gb
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
volumes:
- ./data/postgres:/var/lib/postgresql/data
configs:
bitcoinconf:
content: |
txindex=1
server=1
rest=1
maxtipage=504576000
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
rpcport=8332
rpcuser=${RPC_USER:-bitcoin}
rpcpassword=${RPC_PASSWORD:-opcatAwesome}
rpcworkqueue=2048
rpcthreads=32
rpcservertimeout=120
zmqpubhashblock=tcp://0.0.0.0:8330
zmqpubrawtx=tcp://0.0.0.0:8331
maxconnections=50
mempoolfullrbf=0
# Option for better Fulcrum performance of Fulcrum
# https://github.com/cculianu/Fulcrum/tree/master?tab=readme-ov-file#requirements
zmqpubhashblock=tcp://0.0.0.0:8433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment