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.
This commit is contained in:
@@ -42,10 +42,13 @@ export MINDIFF=$(q '.mindiff // 1000')
|
|||||||
export MAXDIFF=$(q '.maxdiff // 0')
|
export MAXDIFF=$(q '.maxdiff // 0')
|
||||||
export DROPIDLE=$(q '.dropidle // 0')
|
export DROPIDLE=$(q '.dropidle // 0')
|
||||||
LOG_LEVEL=$(q '.log-level // "info"')
|
LOG_LEVEL=$(q '.log-level // "info"')
|
||||||
|
ZMQ_ENABLED=$(q '.zmq-enabled // true')
|
||||||
|
|
||||||
export LOGDIR=/var/log/ckpool
|
export LOGDIR=/var/log/ckpool
|
||||||
export SOCKET_DIR=/run/ckpool
|
export SOCKET_DIR=/run/ckpool
|
||||||
export BITCOIN_NOTIFY=true
|
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 ZMQ_BLOCK=""
|
||||||
export BLOCKPOLL_MS=100
|
export BLOCKPOLL_MS=100
|
||||||
export UPDATE_INTERVAL_S=30
|
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 BITCOIN_RPC_URL="http://${BITCOIN_RPC_HOST}:${BITCOIN_RPC_PORT}"
|
||||||
export POLL_INTERVAL=5s
|
export POLL_INTERVAL=5s
|
||||||
export KAMADO_LOG_LEVEL="${LOG_LEVEL}"
|
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"
|
echo "kamado-entrypoint: starting kamado-api"
|
||||||
/usr/local/bin/kamado-api &
|
/usr/local/bin/kamado-api &
|
||||||
|
|||||||
@@ -129,6 +129,13 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
|
|||||||
"range": "[0,*)",
|
"range": "[0,*)",
|
||||||
"integral": true,
|
"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": {
|
"log-level": {
|
||||||
"type": "enum",
|
"type": "enum",
|
||||||
"name": "Log Level",
|
"name": "Log Level",
|
||||||
|
|||||||
Reference in New Issue
Block a user