the block explorer sites show either a known pool or 'unknown' for this variable
how can i set up an argument for bitcoind to display the string which shows the 'relayed by'/coinbase message?
OS: ubuntu 22.04 default
example:
UpdateTip: new best=xxxx... blah1 blah2 blah3... coinbase message:'mined by pool'
i know i could use 'bitcoin-cli getinfo hash' manually after i see the updatetip from bitcoind but i was wondering if its possible to have this done in bitcoind automatically?
would something like:
bitcoind -blocknotify="bitcoin-cli getblock %s 2 | less | grep coinbase | awk -F '"' '{print $4}' | xxd -r -p"
be the answer?
this doesnt quite work and gives me a ">" (waiting for input) instead of running bitcoind
edit:
ive put the code:
bitcoin-cli getblock %s 2 | less | grep coinbase | awk -F '"' '{print $4}' | xxd -r -p
into blocknotify.txt (same directory) and using:
bitcoind -blocknotify="cat blocknotify.txt"
but im thinking that it wouldnt appear in the same terminal that bicoind is running...
final edit:
got it working:blocknotify.sh (remember to 'chown +x blocknotify.sh'):
#!/bin/bash
bitcoin-cli getblock "$@" 2 | less | grep coinbase | awk -F '"' '{print $4}' | xxd -r -p
then run bitcoind with path to blocknotify.sh and argument %s:
bitcoind -blocknotify="/path/to/blocknotify.sh %s"
it now shows the coinbase message along with an audible beep