Files
KamadoPool-StartOS-0351/scripts/procedures/getConfig.ts
T
satoshi 00c882a8d2 Lower fallback grace default from 30s to 3s
ckpool patch 0004 now bounds generator_submitblock's wait for a live
primary to ~3s rather than spinning indefinitely, and calls submit
before writing the pending-block hex to disk so the happy path adds
zero latency. The right default is small: a fallback should kick in
while the work is still relevant for the current chain tip.

Range widened to [1, 600] so impatient operators can crank further
down. Description updated to reflect the new architecture.
2026-04-27 21:53:53 +03:00

261 lines
9.5 KiB
TypeScript

import { compat, types as T } from "../deps.ts";
export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
"bitcoind": {
"type": "union",
"name": "Bitcoin Core",
"description":
"Select which Bitcoin Core node Kamado should use. Both variants work — pick whichever is installed on your server.",
"tag": {
"id": "type",
"name": "Network",
"description": "Mainnet bitcoind or the testnet4 variant.",
"variant-names": {
"bitcoind": "Bitcoin Core (mainnet)",
"bitcoind-testnet": "Bitcoin Core (testnet4)",
},
},
"default": "bitcoind",
"variants": {
"bitcoind": {
"user": {
"type": "pointer",
"name": "RPC Username",
"description": "The RPC username from Bitcoin Core.",
"subtype": "package",
"package-id": "bitcoind",
"target": "config",
"multi": false,
"selector": "$.rpc.username",
},
"password": {
"type": "pointer",
"name": "RPC Password",
"description": "The RPC password from Bitcoin Core.",
"subtype": "package",
"package-id": "bitcoind",
"target": "config",
"multi": false,
"selector": "$.rpc.password",
},
},
"bitcoind-testnet": {
"user": {
"type": "pointer",
"name": "RPC Username",
"description": "The RPC username from Bitcoin Core (testnet4).",
"subtype": "package",
"package-id": "bitcoind-testnet",
"target": "config",
"multi": false,
"selector": "$.rpc.username",
},
"password": {
"type": "pointer",
"name": "RPC Password",
"description": "The RPC password from Bitcoin Core (testnet4).",
"subtype": "package",
"package-id": "bitcoind-testnet",
"target": "config",
"multi": false,
"selector": "$.rpc.password",
},
},
},
},
"stratum-port": {
"type": "number",
"name": "Stratum Port",
"description":
"TCP port the plaintext stratum server listens on inside the container. Most miners connect here.",
"nullable": false,
"default": 3333,
"range": "[1,65535]",
"integral": true,
},
"tls": {
"type": "union",
"name": "Stratum TLS",
"description":
"Optionally accept stratum connections over TLS via an stunnel sidecar. A self-signed certificate is generated once on first start and persisted — miners must connect with TLS verification disabled (stratum+ssl:// plus a skip-verify flag).",
"tag": {
"id": "enabled",
"name": "Mode",
"description": "Disable or enable TLS termination.",
"variant-names": {
"disabled": "Disabled",
"enabled": "Enabled",
},
},
"default": "disabled",
"variants": {
"disabled": {},
"enabled": {
"port": {
"type": "number",
"name": "TLS Port",
"description":
"TCP port stunnel listens on for TLS stratum connections.",
"nullable": false,
"default": 3334,
"range": "[1,65535]",
"integral": true,
},
},
},
},
"advanced": {
"type": "object",
"name": "Advanced",
"description":
"Fine-tuning knobs for vardiff, logging, and block notifications. Safe to ignore — the defaults work well for Bitaxe-class miners.",
"spec": {
"pool-identifier": {
"type": "string",
"name": "Coinbase Tag",
"description":
"Short string embedded in the coinbase transaction of solved blocks.",
"nullable": false,
"default": "/Kamado/",
"masked": false,
"copyable": false,
},
"startdiff": {
"type": "number",
"name": "Starting Difficulty",
"description":
"Initial vardiff target for new miner connections. Bitaxe-class miners typically land around 16384.",
"nullable": false,
"default": 16384,
"range": "[1,*)",
"integral": true,
},
"mindiff": {
"type": "number",
"name": "Minimum Difficulty",
"description": "Floor for the vardiff algorithm.",
"nullable": false,
"default": 1000,
"range": "[1,*)",
"integral": true,
},
"maxdiff": {
"type": "number",
"name": "Maximum Difficulty",
"description":
"Ceiling for the vardiff algorithm. 0 means no cap.",
"nullable": false,
"default": 0,
"range": "[0,*)",
"integral": true,
},
"dropidle": {
"type": "number",
"name": "Drop Idle (seconds)",
"description":
"Disconnect clients that have not submitted a share in this many seconds. 0 disables the idle disconnect.",
"nullable": false,
"default": 0,
"range": "[0,*)",
"integral": true,
},
"zmq-enabled": {
"type": "boolean",
"name": "Enable ZMQ Block Notifications",
"description":
"Subscribe to Bitcoin Core's hashblock ZMQ topic for sub-second chain refresh on the dashboard. Requires zmqpubhashblock on bitcoind.",
"default": true,
},
"log-level": {
"type": "enum",
"name": "Log Level",
"description": "Verbosity of the kamado-api log output.",
"values": ["debug", "info", "warn", "error"],
"value-names": {
"debug": "Debug",
"info": "Info",
"warn": "Warn",
"error": "Error",
},
"default": "info",
},
"mempool-explorer": {
"type": "union",
"name": "Block Explorer",
"description":
"Where Kamado's UI links should send you when you click a block hash or a user's BTC address. Defaults to mempool.space (the public instance). Switch to 'Custom' to point Kamado at a self-hosted mempool.space mirror — useful if you run mempool as another StartOS service or on the same network.",
"tag": {
"id": "type",
"name": "Source",
"description": "Public mempool.space, or your own instance.",
"variant-names": {
"default": "mempool.space (default)",
"custom": "Custom URL",
},
},
"default": "default",
"variants": {
"default": {},
"custom": {
"url": {
"type": "string",
"name": "Mempool URL",
"description":
"Base URL of your mempool instance, e.g. https://mempool.example.com. Kamado will append /address/<addr> and /block/<hash> to it, so the instance must follow the standard mempool.space URL layout.",
"nullable": false,
"default": "",
"pattern": "^https?://[^\\s]+$",
"pattern-description":
"Must be an http:// or https:// URL with no whitespace.",
"masked": false,
"copyable": false,
},
},
},
},
"block-broadcast-fallback": {
"type": "object",
"name": "Block Broadcast Fallback",
"description":
"Safety net for the moment a share meets network difficulty. ckpool always submits the block to its primary bitcoind first; if that fails (bitcoind crashed, RPC saturated, peering broken), kamado-api re-broadcasts the raw block to one or more backup RPC URLs you list here. A block is only re-submitted if it hasn't been accepted within the grace window — well-behaved primaries are never disturbed.",
"spec": {
"enabled": {
"type": "boolean",
"name": "Enable fallback broadcaster",
"description":
"Off by default. Turning on requires at least one Backup RPC URL — without one we'd just log warnings about pending blocks we can't help with.",
"default": false,
},
"grace-seconds": {
"type": "number",
"name": "Grace period (seconds)",
"description":
"How long a block waits before kamado-api considers ckpool's submission attempt failed and broadcasts via fallback. The patched ckpool returns from submit within ~3s rather than spinning indefinitely on a dead primary, so 3s is the right default — fast enough that fallback work happens while the block is still novel, long enough that a slow round-trip on a healthy primary doesn't trigger a spurious fallback.",
"nullable": false,
"range": "[1,600]",
"integral": true,
"units": "seconds",
"default": 3,
},
"backup-rpcs": {
"type": "list",
"name": "Backup Bitcoin RPC URLs",
"description":
"Each entry is a full bitcoind RPC URL, optionally with credentials inline (https://user:pass@host:8332/). Used in order. Anything that speaks the standard JSON-RPC submitblock method works — a second self-hosted bitcoind, an authenticated public RPC service (Quicknode, GetBlock.io, Allnodes, etc.), or a peer node you trust. Leaving this empty disables the broadcaster.",
"subtype": "string",
"spec": {
"pattern": "^https?://[^\\s]+$",
"pattern-description":
"Must be an http:// or https:// URL with no whitespace.",
"masked": false,
"copyable": false,
},
"default": [],
"range": "[0,10]",
},
},
},
},
},
});