|
1 | 1 | <p align="center"> |
2 | | - <img src="icon.png" alt="Project Logo" width="21%"> |
| 2 | + <img src="icon.png" alt="Public Pool Logo" width="21%"> |
3 | 3 | </p> |
4 | 4 |
|
5 | | -# Public Pool for StartOS |
| 5 | +# Public Pool on StartOS |
| 6 | + |
| 7 | +> **Upstream docs:** <https://github.com/benjamin-wilson/public-pool#readme> |
| 8 | +> |
| 9 | +> Everything not listed in this document should behave the same as upstream |
| 10 | +> Public Pool v0.2.5. If a feature, setting, or behavior is not mentioned |
| 11 | +> here, the upstream documentation is accurate and fully applicable. |
| 12 | +
|
| 13 | +[Public Pool](https://github.com/benjamin-wilson/public-pool) is an open source Bitcoin mining pool with a Stratum server and web UI. |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Table of Contents |
| 18 | + |
| 19 | +- [Image and Container Runtime](#image-and-container-runtime) |
| 20 | +- [Volume and Data Layout](#volume-and-data-layout) |
| 21 | +- [Installation and First-Run Flow](#installation-and-first-run-flow) |
| 22 | +- [Configuration Management](#configuration-management) |
| 23 | +- [Network Access and Interfaces](#network-access-and-interfaces) |
| 24 | +- [Actions (StartOS UI)](#actions-startos-ui) |
| 25 | +- [Dependencies](#dependencies) |
| 26 | +- [Backups and Restore](#backups-and-restore) |
| 27 | +- [Health Checks](#health-checks) |
| 28 | +- [Limitations and Differences](#limitations-and-differences) |
| 29 | +- [What Is Unchanged from Upstream](#what-is-unchanged-from-upstream) |
| 30 | +- [Contributing](#contributing) |
| 31 | +- [Quick Reference for AI Consumers](#quick-reference-for-ai-consumers) |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Image and Container Runtime |
| 36 | + |
| 37 | +| Property | Value | |
| 38 | +|----------|-------| |
| 39 | +| Image | Custom Dockerfile (multi-stage build from upstream source) | |
| 40 | +| Base | `node:20-bookworm-slim` + nginx | |
| 41 | +| Architectures | x86_64, aarch64 (emulated) | |
| 42 | + |
| 43 | +The image is built from source, compiling both the backend (public-pool) and frontend (public-pool-ui) with StartOS-specific patches applied to the UI. |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +## Volume and Data Layout |
| 48 | + |
| 49 | +| Volume | Mount Point | Purpose | |
| 50 | +|--------|-------------|---------| |
| 51 | +| `main` | various | All Public Pool data | |
| 52 | + |
| 53 | +**Key paths on the `main` volume:** |
| 54 | + |
| 55 | +- `.env` — environment configuration file |
| 56 | +- `store.json` — persists Stratum display address |
| 57 | +- `mainnet/` — mainnet database (mounted to `/public-pool/DB`) |
| 58 | +- `testnet/` — testnet database (mounted to `/public-pool/DB`) |
| 59 | + |
| 60 | +**Bitcoin dependency mount:** |
| 61 | + |
| 62 | +- `/mnt/bitcoind` — Bitcoin Core volume (read-only, for cookie auth) |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## Installation and First-Run Flow |
| 67 | + |
| 68 | +| Step | Upstream | StartOS | |
| 69 | +|------|----------|---------| |
| 70 | +| Installation | Docker Compose | Install from marketplace | |
| 71 | +| Configuration | Edit `.env` file manually | Auto-configured, tunable via action | |
| 72 | +| Bitcoin Core | Manual RPC setup | Auto-configured via dependency | |
| 73 | +| Network | Single network only | Switchable between mainnet and testnet | |
| 74 | + |
| 75 | +**First-run steps:** |
| 76 | + |
| 77 | +1. Ensure Bitcoin Core (or Bitcoin Testnet) is installed |
| 78 | +2. Install Public Pool from the StartOS marketplace |
| 79 | +3. Optionally run "Configure" to set a custom pool identifier |
| 80 | +4. Point your mining hardware at the Stratum interface |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Configuration Management |
| 85 | + |
| 86 | +### Auto-Configured by StartOS |
| 87 | + |
| 88 | +| Setting | Value | Purpose | |
| 89 | +|---------|-------|---------| |
| 90 | +| `BITCOIN_RPC_URL` | `http://bitcoind.startos` | Bitcoin RPC (mainnet) | |
| 91 | +| `BITCOIN_RPC_PORT` | `8332` / `48332` | RPC port (mainnet/testnet) | |
| 92 | +| `BITCOIN_RPC_COOKIEFILE` | `/mnt/bitcoind/.cookie` | Cookie auth | |
| 93 | +| `BITCOIN_ZMQ_HOST` | `tcp://bitcoind.startos:28332` | ZMQ notifications | |
| 94 | +| `BITCOIN_RPC_TIMEOUT` | `10000` | RPC timeout (ms) | |
| 95 | +| `API_PORT` | `3334` | Internal API port | |
| 96 | +| `STRATUM_PORT` | `3333` | Stratum protocol port | |
| 97 | +| `API_SECURE` | `false` | API security | |
| 98 | + |
| 99 | +### Configurable via Actions |
| 100 | + |
| 101 | +| Setting | Action | Default | Purpose | |
| 102 | +|---------|--------|---------|---------| |
| 103 | +| Pool Identifier | Configure | `Public-Pool` | Coinbase transaction identifier | |
| 104 | +| Server Display URL | Configure | Auto-detected IPv4 | Homepage display address | |
| 105 | +| Network | Switch Network | mainnet | Toggle mainnet/testnet | |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Network Access and Interfaces |
| 110 | + |
| 111 | +| Interface | Port | Protocol | Purpose | |
| 112 | +|-----------|------|----------|---------| |
| 113 | +| Web UI | 80 | HTTP | Pool dashboard and statistics | |
| 114 | +| Stratum Server | 3333 | TCP | Mining protocol | |
| 115 | + |
| 116 | +**Access methods (StartOS 0.4.0):** |
| 117 | + |
| 118 | +- LAN IP with unique port |
| 119 | +- `<hostname>.local` with unique port |
| 120 | +- Tor `.onion` address |
| 121 | +- Custom domains (if configured) |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Actions (StartOS UI) |
| 126 | + |
| 127 | +### Configure |
| 128 | + |
| 129 | +| Property | Value | |
| 130 | +|----------|-------| |
| 131 | +| ID | `config` | |
| 132 | +| Visibility | Enabled | |
| 133 | +| Availability | Any status | |
| 134 | +| Purpose | Set pool identifier and display URL | |
| 135 | + |
| 136 | +**Inputs:** |
| 137 | + |
| 138 | +- **Pool Identifier** — ASCII text included in Coinbase transactions (max 100 chars) |
| 139 | +- **Server Display URL** — the address shown on your pool's homepage (auto-populated from available interfaces) |
| 140 | + |
| 141 | +### Switch Network |
| 142 | + |
| 143 | +| Property | Value | |
| 144 | +|----------|-------| |
| 145 | +| ID | `set-network` | |
| 146 | +| Visibility | Enabled | |
| 147 | +| Availability | Any status | |
| 148 | +| Purpose | Toggle between mainnet and testnet | |
| 149 | + |
| 150 | +Dynamically shows "Switch to testnet" or "Switch to mainnet" based on current configuration. Includes a confirmation warning. |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +## Dependencies |
| 155 | + |
| 156 | +| Dependency | Required | Version | Purpose | Auto-Config | |
| 157 | +|------------|----------|---------|---------|-------------| |
| 158 | +| Bitcoin Core | Optional | >=29.1 | Mainnet mining | ZMQ enabled | |
| 159 | +| Bitcoin Testnet | Optional | >=29.1 | Testnet mining | ZMQ enabled | |
| 160 | + |
| 161 | +One of the two Bitcoin dependencies is required depending on the selected network. StartOS creates a critical task to enable ZMQ on the active Bitcoin node. |
| 162 | + |
| 163 | +--- |
| 164 | + |
| 165 | +## Backups and Restore |
| 166 | + |
| 167 | +**Included in backup:** |
| 168 | + |
| 169 | +- `main` volume — configuration, database, and state |
| 170 | + |
| 171 | +**Restore behavior:** |
| 172 | + |
| 173 | +- All mining history and configuration restored |
| 174 | +- Service resumes normal operation |
| 175 | + |
| 176 | +--- |
| 177 | + |
| 178 | +## Health Checks |
| 179 | + |
| 180 | +| Check | Display Name | Grace Period | Messages | |
| 181 | +|-------|--------------|-------------|----------| |
| 182 | +| Stratum | Stratum Server | 15s | Ready / Not ready | |
| 183 | +| Web UI | Web Interface | Default | Ready / Not ready | |
| 184 | + |
| 185 | +--- |
| 186 | + |
| 187 | +## Limitations and Differences |
| 188 | + |
| 189 | +1. **Custom Docker image** — built from source with UI patches for display URL injection |
| 190 | +2. **Single network** — cannot mine on mainnet and testnet simultaneously (switchable via action) |
| 191 | +3. **Architecture emulation** — aarch64 builds use emulation |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +## What Is Unchanged from Upstream |
| 196 | + |
| 197 | +- Full Stratum protocol support |
| 198 | +- Mining statistics and dashboard |
| 199 | +- Block discovery tracking |
| 200 | +- Worker management |
| 201 | +- Coinbase transaction customization |
| 202 | +- All web UI features |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +## Contributing |
| 207 | + |
| 208 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for build instructions and development workflow. |
| 209 | + |
| 210 | +--- |
| 211 | + |
| 212 | +## Quick Reference for AI Consumers |
| 213 | + |
| 214 | +```yaml |
| 215 | +package_id: public-pool |
| 216 | +upstream_version: 0.2.5 |
| 217 | +image: custom (dockerBuild from upstream source) |
| 218 | +architectures: [x86_64, aarch64] |
| 219 | +volumes: |
| 220 | + main: |
| 221 | + .env: environment configuration |
| 222 | + store.json: stratum display address |
| 223 | + mainnet/: mainnet database |
| 224 | + testnet/: testnet database |
| 225 | +ports: |
| 226 | + ui: 80 |
| 227 | + stratum: 3333 |
| 228 | + api: 3334 (internal) |
| 229 | +dependencies: |
| 230 | + bitcoind: |
| 231 | + required: false (one of bitcoind or bitcoind-testnet required) |
| 232 | + min_version: ">=29.1" |
| 233 | + enforced_config: [zmqEnabled=true] |
| 234 | + bitcoind-testnet: |
| 235 | + required: false |
| 236 | + min_version: ">=29.1" |
| 237 | + enforced_config: [zmqEnabled=true] |
| 238 | +actions: |
| 239 | + - config (enabled, any) |
| 240 | + - set-network (enabled, any) |
| 241 | +health_checks: |
| 242 | + - stratum: port_listening 3333 (15s grace) |
| 243 | + - ui: port_listening 80 |
| 244 | +backup_volumes: |
| 245 | + - main |
| 246 | +startos_managed_config: |
| 247 | + BITCOIN_RPC_TIMEOUT: "10000" |
| 248 | + API_PORT: "3334" |
| 249 | + STRATUM_PORT: "3333" |
| 250 | + API_SECURE: "false" |
| 251 | +not_available: |
| 252 | + - Simultaneous mainnet and testnet mining |
| 253 | +``` |
0 commit comments