diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh index cf42899..d0c2f11 100755 --- a/docker_entrypoint.sh +++ b/docker_entrypoint.sh @@ -42,10 +42,13 @@ export MINDIFF=$(q '.mindiff // 1000') export MAXDIFF=$(q '.maxdiff // 0') export DROPIDLE=$(q '.dropidle // 0') LOG_LEVEL=$(q '.log-level // "info"') +ZMQ_ENABLED=$(q '.zmq-enabled // true') export LOGDIR=/var/log/ckpool export SOCKET_DIR=/run/ckpool export BITCOIN_NOTIFY=true +# ckpool itself doesn't use ZMQ in this build — zmqblock is stripped +# from the rendered conf below. kamado-api subscribes separately. export ZMQ_BLOCK="" export BLOCKPOLL_MS=100 export UPDATE_INTERVAL_S=30 @@ -86,6 +89,11 @@ export CKPOOL_LOGFILE="${LOGDIR}/ckpool.log" export BITCOIN_RPC_URL="http://${BITCOIN_RPC_HOST}:${BITCOIN_RPC_PORT}" export POLL_INTERVAL=5s export KAMADO_LOG_LEVEL="${LOG_LEVEL}" +if [[ "${ZMQ_ENABLED}" == "true" ]]; then + export BITCOIN_ZMQ_BLOCK="tcp://${BITCOIN_RPC_HOST}:28332" +else + export BITCOIN_ZMQ_BLOCK="" +fi echo "kamado-entrypoint: starting kamado-api" /usr/local/bin/kamado-api & diff --git a/scripts/procedures/getConfig.ts b/scripts/procedures/getConfig.ts index 22984e4..bbc2c89 100644 --- a/scripts/procedures/getConfig.ts +++ b/scripts/procedures/getConfig.ts @@ -129,6 +129,13 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({ "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 to be enabled on your bitcoind — the default StartOS bitcoind package exposes it on tcp://bitcoind.embassy:28332.", + "default": true, + }, "log-level": { "type": "enum", "name": "Log Level",