Files
satoshi 5799391321 Fix config generation error for zmq-enabled on upgrade
The field was moved to the top level but not marked nullable, so
upgrades from older configs (where it lived under advanced) failed
with "Field Is Not Nullable". The entrypoint already falls back to
true via yq's // operator.
2026-05-23 13:47:24 +03:00

220 lines
7.1 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": "TLS 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,
},
},
},
},
"zmq-enabled": {
"type": "boolean",
"name": "Enable ZMQ Block Notifications",
"description":
"Subscribe to Bitcoin Core's hashblock ZMQ topic for sub-second block detection on the dashboard. Requires zmqpubhashblock enabled on bitcoind.",
"nullable": true,
"default": true,
},
"advanced": {
"type": "object",
"name": "Advanced",
"description":
"Fine-tuning knobs for vardiff, logging, and block explorer links. 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": true,
"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": true,
"default": 16384,
"range": "[1,*)",
"integral": true,
},
"mindiff": {
"type": "number",
"name": "Minimum Difficulty",
"description": "Floor for the vardiff algorithm.",
"nullable": true,
"default": 1000,
"range": "[1,*)",
"integral": true,
},
"maxdiff": {
"type": "number",
"name": "Maximum Difficulty",
"description":
"Ceiling for the vardiff algorithm. 0 means no cap.",
"nullable": true,
"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": true,
"default": 0,
"range": "[0,*)",
"integral": 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": "Block explorer for dashboard links",
"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": "URL (e.g. your own Mempool instance's address)",
"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": true,
"default": "",
"pattern": "^https?://[^\\s]+$",
"pattern-description":
"Must be an http:// or https:// URL with no whitespace.",
"masked": false,
"copyable": false,
},
},
},
},
},
},
});