Author

Topic: bitcoind to display coinbase message/relayed by: string (Read 81 times)

member
Activity: 152
Merit: 25
thanks loyce,
https://bitcointalksearch.org/topic/m.4933145
that link helped me to figure it out

see edited OP for solution ( I was using /s instead of %s and didn't supply %s as argument when calling blocknotify.sh --oops)
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
i like to see when new blocks are generated
See if you can find a working version of BitBonkers somewhere. It was a nice site to see new blocks years ago.
member
Activity: 152
Merit: 25
thanks, i will try a .sh script

i like to see when new blocks are generated, now i just want to add the relayed by info aswell

i couldnt find anything using search and google also, im surprised no one has asked this question before
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Code:
bitcoind -blocknotify="cat blocknotify.txt"
It looks like blocknotify needs to run a script, not a text file.

but im thinking that it wouldnt appear in the same terminal that bicoind is running...
I'd say you can use blocknotify to output the data to a (text) file, and use tail -f on your terminal to view it.

Why keep bitcoind running in a terminal in the first place? I started mine on January 8, and it's output is invisible for me.
member
Activity: 152
Merit: 25
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:

Code:
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:

Code:
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:

Code:
bitcoin-cli getblock %s 2 | less | grep coinbase | awk -F '"' '{print $4}' | xxd -r -p

into blocknotify.txt (same directory) and using:
Code:
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'):
Code:
#!/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:
Code:
bitcoind -blocknotify="/path/to/blocknotify.sh %s"

it now shows the coinbase message along with an audible beep 

Jump to: