|
| 1 | +# simplepool — docker deployment |
| 2 | + |
| 3 | +Runs the three simplepool services (stratum proxy, dashboard, payout worker) |
| 4 | +against a Thunder daemon and a Bitcoin Core node that live outside this |
| 5 | +compose stack (typically on the same host). |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- Docker Engine 24+ with the `compose` plugin |
| 10 | +- A running Bitcoin Core (mainnet / forknet) reachable from this host |
| 11 | +- A running Thunder daemon with JSON-RPC exposed on some host:port |
| 12 | +- Ports **3334** (stratum) and **8081** (dashboard, override via env) free |
| 13 | + |
| 14 | +## First run |
| 15 | + |
| 16 | +```bash |
| 17 | +cd deploy/docker |
| 18 | + |
| 19 | +# 1. Configure the compose stack |
| 20 | +cp .env.example .env |
| 21 | +$EDITOR .env |
| 22 | + |
| 23 | +# 2. Provide a proxy.conf. Start from the repo template and edit: |
| 24 | +cp ../../proxy.conf.example proxy.conf |
| 25 | +$EDITOR proxy.conf |
| 26 | +# IMPORTANT: inside the container the DB path must be /data/shares.db |
| 27 | +# set: db_path = /data/shares.db |
| 28 | +# bitcoind_url can stay 127.0.0.1 because simplepool runs in host network mode. |
| 29 | + |
| 30 | +# 3. Build images and bring the stack up |
| 31 | +docker compose up -d --build |
| 32 | + |
| 33 | +# 4. Watch the logs |
| 34 | +docker compose logs -f simplepool |
| 35 | +docker compose logs -f dashboard |
| 36 | +docker compose logs -f payout |
| 37 | +``` |
| 38 | + |
| 39 | +## Container-facing paths |
| 40 | + |
| 41 | +Everything reads/writes the same SQLite file via a shared bind mount: |
| 42 | + |
| 43 | +| host path | container path | who writes | |
| 44 | +|------------------------|-----------------------|-------------------------------| |
| 45 | +| `../../data/` | `/data/` | simplepool (RW), payout (RW), dashboard (RO) | |
| 46 | +| `./proxy.conf` | `/etc/simplepool/proxy.conf` | simplepool reads | |
| 47 | + |
| 48 | +`../../data` is the repo's `data/` folder — same as the bare-metal deploy. |
| 49 | + |
| 50 | +## Networking |
| 51 | + |
| 52 | +- **simplepool** uses `network_mode: host` so miners hit `:3334` without NAT |
| 53 | + and so `bitcoind_url = http://127.0.0.1:8332` in `proxy.conf` works |
| 54 | + unchanged from bare-metal setups. |
| 55 | +- **dashboard** and **payout** use the default bridge; they reach Thunder via |
| 56 | + `host.docker.internal:6009` (which `extra_hosts` maps to the host gateway |
| 57 | + on Linux, native on macOS/Windows). If Thunder lives on a different box, |
| 58 | + set `THUNDER_RPC_URL` to a real hostname/IP. |
| 59 | + |
| 60 | +## Updating after a code change |
| 61 | + |
| 62 | +```bash |
| 63 | +git pull |
| 64 | +docker compose up -d --build |
| 65 | +``` |
| 66 | + |
| 67 | +Compose rebuilds only images whose sources changed (via layer cache) and |
| 68 | +restarts only the affected containers. Stratum drops connections on restart — |
| 69 | +miners auto-reconnect within seconds. |
| 70 | + |
| 71 | +## Common operations |
| 72 | + |
| 73 | +```bash |
| 74 | +# Stop the stack |
| 75 | +docker compose down |
| 76 | + |
| 77 | +# Tail one service's log |
| 78 | +docker compose logs -f payout |
| 79 | + |
| 80 | +# Get a shell in the running dashboard container |
| 81 | +docker compose exec dashboard sh |
| 82 | + |
| 83 | +# Rebuild just one image after editing its Dockerfile |
| 84 | +docker compose build simplepool |
| 85 | +docker compose up -d simplepool |
| 86 | + |
| 87 | +# Payout worker: do a dry-run cycle (no broadcast) |
| 88 | +PAYOUT_DRY_RUN=1 docker compose up payout |
| 89 | +``` |
| 90 | + |
| 91 | +## What this stack does NOT include |
| 92 | + |
| 93 | +- **bitcoind / drivechain-forknet** — the mainchain node |
| 94 | +- **Thunder daemon** — the sidechain node |
| 95 | +- **bip300301_enforcer** — the BMM enforcer |
| 96 | +- **electrs / esplora** — mainchain indexer used by the enforcer |
| 97 | + |
| 98 | +Those form the drivechain infrastructure below simplepool. Install them on |
| 99 | +the host (see the project's [INSTALL.md](../../INSTALL.md)) and point |
| 100 | +`bitcoind_url` in `proxy.conf` + `THUNDER_RPC_URL` in `.env` at them. |
0 commit comments