cyphernode icon indicating copy to clipboard operation
cyphernode copied to clipboard

dev branch - mosquitto_pub to multiple topics

Open phillamy opened this issue 2 years ago • 2 comments

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}}"

phillamy avatar Nov 22 '23 16:11 phillamy

#310 linked

phillamy avatar Nov 22 '23 16:11 phillamy