cyphernode
cyphernode copied to clipboard
dev branch - mosquitto_pub to multiple topics
mosquitto_pub does not support publishing a message to multiple topics
See cyphernode/cyphernodeconf_docker/templates/bitcoin/blocknotify.sh cyphernode/cyphernodeconf_docker/templates/bitcoin/walletnotify.sh
A fix has to be made to invoke mosquitto_pub 2 times - on each topic:
# Topic 'newblock' will be removed eventually
echo "[blocknotify-$$] mosquitto_pub -h broker -t newblock -t bitcoinnode/newblock -m \"{\"blockhash\":\"${blockhash}\",\"blockheight\":${blockheight}}\""
mosquitto_pub -h broker -t newblock -m "{\"blockhash\":\"${blockhash}\",\"blockheight\":${blockheight}}"
mosquitto_pub -h broker -t bitcoinnode/newblock -m "{\"blockhash\":\"${blockhash}\",\"blockheight\":${blockheight}}"
#310 linked