how to show coinbase message in bitcoind output

4 replies 281 views
vault2019Member
Posts: 57 · Reputation: 212
#1Feb 5, 2022, 10:33 PM
I've noticed that on block explorer sites, they either show a known mining pool or just say 'unknown' for the relayed by info. So, I'm curious if there's a way to configure bitcoind to automatically display the string that includes the 'relayed by' or coinbase message right away? I'm running it on Ubuntu 22.04 by the way. For instance, I know I could manually run 'bitcoin-cli getinfo hash' after I see the updatetip from bitcoind, but it would be way cooler if bitcoind could do this automatically, right? Would something like this work? But when I tried that, I ended up getting a ">" prompt waiting for input instead of actually executing bitcoind. Edit: I put the code into blocknotify.txt in the same folder and used it like this. But I'm starting to think it won't show up in the terminal where bitcoind is running... Final edit: I figured it out! So, I made a blocknotify.sh script (don’t forget to 'chown +x blocknotify.sh') and then ran bitcoind with the path to blocknotify.sh along with the %s argument. Now it displays the coinbase message and even gives an audible beep!
7 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#2Feb 5, 2022, 11:04 PM
It looks like blocknotify needs to run a script, not a text file. 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.
0 Reply Quote Share
vault2019Member
Posts: 57 · Reputation: 212
#3Feb 5, 2022, 11:31 PM
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
2 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#4Feb 6, 2022, 04:01 AM
See if you can find a working version of BitBonkers somewhere. It was a nice site to see new blocks years ago.
2 Reply Quote Share
vault2019Member
Posts: 57 · Reputation: 212
#5Feb 7, 2022, 10:28 AM
thanks loyce, https://bitcointalk.org/index.php?topic=448565.msg4933145#msg4933145 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)
6 Reply Quote Share

Related topics