Commit Graph
15 Commits
Author SHA1 Message Date
satoshi dc33bb7694 Wire ckpool to real ZMQ endpoint and enable blockpoll
With BITCOIN_NOTIFY=true, ckpool's generator_getbest short-circuits
to GETBEST_NOTIFY (generator.c:902) and the blockupdate loop sleeps
5s doing nothing (stratifier.c:4695). It then expects ZMQ to push
new-tip events — but our ZMQ_BLOCK was empty and ckpool defaults to
tcp://127.0.0.1:28332 (ckpool.c:1795), which has nothing listening
inside this container. Net effect: ckpool was blind to tip changes,
so miners kept hashing the stale work until the next 30s
update_interval finally pulled a new template. Observed was a
16-second gap between bitcoind's UpdateTip log line and ckpool's
subsequent CreateNewBlock call — that's pure wasted hashrate.

Fix both paths:
- BITCOIN_NOTIFY=false so the blockpoll thread actually polls
  getbestblockhash every BLOCKPOLL_MS (100ms).
- ZMQ_BLOCK=tcp://${BITCOIN_RPC_HOST}:28332 so the zmqnotify thread
  subscribes to bitcoind's real hashblock publisher. Whichever path
  sees the new tip first triggers update_base(); both are safe to
  run concurrently.
- Drop the sed line that was stripping zmqblock from the rendered
  conf — we now want it in there.
2026-04-23 01:10:31 +03:00
satoshi 04a8e2d4dc Move ckpool logs and kamado-api DB to persisted volumes
The default LOGDIR and DB_PATH both pointed at ephemeral container
paths, so a service restart wiped the pool's users/workers state,
its block history, and kamado-api's hashrate chart.

- LOGDIR: /var/log/ckpool -> /root/.ckpool/logs (ckpool volume).
  Persists pool/pool.status, users/, workers/, and daily logs.
- DB_PATH: default /var/lib/kamado/kamado.db
  -> /root/.kamado/data/kamado.db (main volume).
  Persists blocks, hashrate_samples, and the kv table that holds
  cumulative pool work.

CKPOOL_LOGFILE follows LOGDIR so kamado-api's log-tailer keeps
picking up ckpool's block-solve lines.
2026-04-22 21:07:36 +03:00
satoshi bfc9553bb9 Properties screen: expose stratum ports, TLS fingerprint, worker format
Entrypoint persists the generated TLS cert fingerprint so the
properties script can read it from the main volume. The screen
shows the active network, plaintext and TLS stratum ports, the
SHA-256 fingerprint for miner pinning, and the worker username
format (BTC address plus optional worker label).
2026-04-14 18:16:41 +03:00
satoshi c9858325cd Use genesis coinbase address for ckpool startup self-test
ckpool-solo validates conf btcaddress once at startup to prime the
coinbase-builder, then pays solves to the worker's stratum address.
The conf value never sees a satoshi, so use the active network's
genesis coinbase address instead of a burn placeholder.
2026-04-14 17:26:42 +03:00
satoshi a63e7256c4 Tidy config: drop payout-address field, group niche options under Advanced
Worker stratum username is the payout address in ckpool-solo, so the
separate field was redundant. Niche vardiff/logging/zmq knobs now
live under an Advanced group with sensible defaults.
2026-04-14 17:10:51 +03:00
satoshi cb739867cc Add optional stratum TLS via stunnel sidecar
New 'tls' union config (disabled by default) spins up an
stunnel4 process inside the container that terminates TLS on
a configurable port (3334 by default) and forwards decrypted
stratum traffic to 127.0.0.1:${STRATUM_PORT}.

Cert is self-signed, generated once on first start with a
10-year validity and persisted at /root/.kamado/tls/ so the
fingerprint stays stable across restarts. SHA-256 fingerprint
is printed to container logs on each startup so users can
pin it on their miners. Miners must connect with
verification disabled (no CA trust chain for a private pool).

Runtime image grows by ~3MB for stunnel4 + openssl. The
supervisor loop now waits on three PIDs and tears all of them
down together if any one exits.
2026-04-14 11:21:45 +03:00
satoshi 74387b8c45 Expose ZMQ block notifications toggle in config
New 'zmq-enabled' boolean (default true) makes the entrypoint
export BITCOIN_ZMQ_BLOCK=tcp://<bitcoind-host>:28332, which
kamado-api's zmqmon subscribes to for sub-second chain refresh
on the dashboard. Disable it if your bitcoind doesn't have
zmqpubhashblock exposed.
2026-04-14 11:16:04 +03:00
satoshi 31abbbd4a1 Use 3-arg compat.setConfig form in setConfig
The 1-arg form tried to call effects.createDir which doesn't
exist in the 0.3.5.1 effects API, crashing config save with
'TypeError: effects.createDir is not a function'. The 3-arg
form (effects, newConfig, deps) just wires up dependencies
based on the chosen bitcoind variant without touching the
filesystem.
2026-04-14 10:28:37 +03:00
satoshi 8c9bfb33af Drop unused compat assets volume
start-sdk pack was failing on 'Copying Assets: No such file'
because the compat volume was declared with type: assets but
had no assets/compat/ directory to populate it.
2026-04-14 10:18:56 +03:00
satoshi 9a64dae04b Use start-sdk's docker-images/<arch>.tar convention
start-sdk pack discovers per-arch tarballs at docker-images/
x86_64.tar and docker-images/aarch64.tar by filename convention,
not via a manifest assets entry. Dropping the invalid
'docker-images: image.tar' assets key and reworking the Makefile
to build one type=docker tarball per arch with arm/x86 single-
arch convenience targets.
2026-04-14 10:14:07 +03:00
satoshi 2812d6dac3 Make PLATFORMS overridable for single-arch test builds
Default still builds linux/arm64/v8+linux/amd64 for shipping,
but 'make PLATFORMS=linux/amd64' skips the arm64 leg on hosts
without qemu-user-static registered.
2026-04-14 10:03:33 +03:00
satoshi 070260002b Build from local KamadoPool checkout via buildx build-context
Replaces the git-clone-at-SHA source stage with a 'FROM scratch
AS source' stage that COPYs from a named build context. The
Makefile passes '--build-context kamado=../KamadoPool' by
default; override with 'make KAMADO_SRC=/elsewhere'. No more
SHA placeholder, no GitHub dependency, no re-clone on every
build — and the image always reflects the working tree.
2026-04-14 09:56:26 +03:00
satoshi 90e745f160 Align Dockerfile and entrypoint with upstream KamadoPool build
Previous scaffold referenced a non-existent 'make ckpool-src'
target. Rewritten to inline the real build steps from the
upstream KamadoPool repo: clone ckpool at CKPOOL_COMMIT, apply
patches/*.patch, build with the same portable CFLAGS the
ckpool Dockerfile uses. The ui and api stages now match
api/Dockerfile exactly.

Entrypoint now uses the same env-var interface as the upstream
ckpool entrypoint (POOL_BTCADDRESS, BITCOIN_RPC_*, STRATUM_PORT,
etc.) and renders ckpool.conf from the bundled template via
sed. kamado-api env vars corrected to match config.FromEnv
(BITCOIN_RPC_URL, CKPOOL_SOCKDIR, CKPOOL_LOGFILE, LISTEN_ADDR).
2026-04-13 18:10:17 +03:00
satoshi 54935bf638 Add configurable stratum port (default 3333)
Exposes stratum-port in the StartOS config UI so users running
simpleproxy or another TCP forwarder can point Kamado at a
non-default port. Entrypoint substitutes the value into
ckpool.conf serverurl.

Also pins placeholder KAMADO_SHA in the Dockerfile — swap to a
real pushed commit before the first build.
2026-04-13 03:54:49 +03:00
satoshi 4064f9e56a Initial StartOS 0.3.5.1 packaging scaffold for Kamado Pool
Multi-stage Dockerfile clones KamadoPool at a pinned SHA, builds
ckpool and kamado-api (with embedded Svelte UI), runtime image
supervises both processes via tini + wait -n. Config covers
bitcoind mainnet/testnet4 variant, payout address, coinbase tag,
vardiff knobs, and log level. Web UI interface only — stratum
:3333 requires a router port-forward or simpleproxy workaround
because StartOS 0.3.x does not forward raw TCP on LAN.

TODO before first build: pin KAMADO_REPO + KAMADO_SHA in the
Dockerfile to a pushed commit.
2026-04-13 03:51:23 +03:00