Add setup wizard, Docker orchestration, and UI improvements#16
Add setup wizard, Docker orchestration, and UI improvements#16warioishere wants to merge 7 commits intostratum-mining:mainfrom
Conversation
- Integrate sv2-wizard with pool connection flow, Bitcoin Core setup, translator proxy and JD client configuration, and deployment result - Add Docker orchestration backend (Dockerode) for container lifecycle - Add wizard intro page with Stratum logo and SV2 path explainers - Add IPC socket path input with host-level verify check - Add Update tab to JDC and tProxy settings (SSE-based image pull) - Add health-based redirect to /setup for first-time users - Self-host Inter and JetBrains Mono fonts via fontsource
When re-running the wizard and going through a step that was skipped in a prior run, the old skipped_<step> flag persisted because updateData only merges. Now handleContinue explicitly sets the flag to false for skippable steps, so deployedTproxy and other consumers pick up the correct state.
Resolve two issues that prevented tProxy from starting in JD mode: 1. Replace Docker hostname with container IP in translator config — the translator proxy binary only accepts IP addresses, not hostnames, causing AddrParseError on startup. 2. Use JDC's authority key instead of the pool's in the translator config — in JD mode the translator connects to JDC, not the pool, so the Noise handshake needs JDC's keypair. Also patches the update route to keep the translator config in sync when either container is recreated.
|
Still got some problems connecting tproxy to jd-client, upstream bug from jd-client? 11:25:20 — Initial connection succeeds (both sides): tProxy: JDC: 11:30:20 — Connection drops after 5 minutes, JDC tries to rebind and FAILS: JDC: After the first downstream disconnects, JDC tries to restart its listener but the old socket is still bound (EADDRINUSE). The stale listener accepts new TCP connections, but JDC's internal state has been reset, so every subsequent handshake fails immediately. Edit: pulled the latest images of jd-client and tproxy from dockerhub. |
- Entrypoint: persist mining address to file for bitcoin-node (no wallet module) - getRegtestInfo: read saved address, estimate balance from block count - mineRegtestBlocks: use generatetodescriptor (works without wallet) - getBlockchainInfo: add -testnet4/-regtest flag so bitcoin-cli connects to the correct RPC port instead of defaulting to mainnet 8332 - Hide misleading sync progress panel for regtest (always shows IBD due to synthetic block timestamps)
This PR combines multiple steps from #2 that were originally planned as separate PRs:
sv2-wizardcomponents — add/setuproute with mode selection and state detectionDockerfile,docker-compose.yml, Nginx config, and orchestration backendGET|POST /api/config,POST /api/restart, live log streaming via SSEIdeally each would have been reviewed independently — apologies for the noise. The good news: everything discussed in Steps 1–3 is integrated and in a working, testable state. Changes are described in detail below. We'll be more disciplined about PR granularity going forward.
What's Included
1. Wizard Integration (
sv2-wizardmerge)The sv2-wizard project has been integrated into this repo. It provides a step-by-step setup wizard that guides miners through connecting to an SV2 pool.
The wizard supports two modes:
stratum+tcp2. Docker Orchestration Backend
A
Node.js/Expressbackend (server/) was added to orchestrate Docker containers:POST /api/setuptproxyand/orjd_clientcontainersGET /api/statusPOST /api/restartGET|POST /api/config?service=jdc|tproxyGET /api/logs?service=...GET|POST /api/wizard-dataConfig files are generated from typed templates with sane defaults. The
constructTemplatesflag drives which components get deployed and howtProxyis wired — either directly to the pool, or through JDC atjd_client:34265.JD Client and tProxy images are pulled directly from the StratumV2 Docker Hub repo.
3. UI Improvements
Settings Page — structured config forms with typed sub-tab forms for JD Client and Translator Proxy:
Basic,Keys,Mining,Upstreams(dynamic list),Template Provider,LogsBasic,Mining,Upstreams(dynamic list),Difficulty,LogsConfig is read/written via
GET|POST /api/config?format=jsonusingsmol-tomlfor parse/serialize.Dashboard
Wizard
tProxysetup for native SV2 miners when setting up own template control4. Integrated Bitcoin Core Stack via Docker
When using JD mode, the wizard offers a one-click option to spin up a Docker-managed Bitcoin Core node with IPC support, pulled from the official image. This enables fully standalone deployments — no separately managed Bitcoin Core node required.
The Bitcoin Core container joins the same Docker network as the SRI components and shares the IPC socket via a volume mount.
5. Connection Details Page (
/connect)A new
/connectpage gives miners a single place to find their connection string after setup:tProxy,jd_client, or neither)stratum+tcp://<host>:<port>endpoint for the active mode:34255— SV1 miners via Translator Proxy34265— native SV2 miners connecting directly to JD ClienttProxymode only) with step-by-stepcpuminerinstructions for users without an ASIC who want to test the stackHow to Test
Prerequisites: Docker and Docker Compose installed.
Then open http://localhost:2121 and:
/setupand run through the wizard.tomlon disk reflects the change/connect— verify the correct endpoint and port are shown for your deployed modeNotes
Please feel free to point out any inappropriate changes — for example, adding my own pool or the welcome page. I'm aware this is a large diff, mainly due to integrating the wizard and adding the Docker orchestrator.
This is a proof of concept. Happy to hear feedback on the approach and split things into separate PRs once we've sorted out any fundamental issues or messy code.