"Watchglass" Genesis.


Update (Aug 2021) : billymg wrote a a very spiffy node explorer based on this program.


Update (May 2020) : Support for "peers" command.


'Watchglass' is a simple program for monitoring the health of a constellation of Bitcoin nodes. The user interface is in the form of an IRC bot, based on my August 2019 'Logotron'. Unlike the latter, this program has no nonstandard library dependencies (i.e. it will operate on a stock Python 2.7 installation.)

The program was written to help in chasing down a possible wedge condition in TRB.

You will need:

Add the above vpatches and seals to your V-set, and press to watchglass_genesis.kv.vpatch watchglass_peers_cmd.kv.vpatch.

Configure and operate as described in README.txt and below.

Currently [2], Watchglass knows how to:

  1. Poll a pre-configured list of hosts, asynchronously, and report the result to the IRC channel in which the poll command had been issued. Each host's response to the version command of the Bitcoin protocol is summarized (including response latency); and, if there is no response within the specified nodetimeout interval, that host is reported busy.

  2. Probe a specified IP (and optionally, a port other than the default 8333) and report similarly to (1). The pertinent bot command, is, unsurprisingly, probe.

Adjust the settings in watchglass.conf to conform to your requirements.

In particular, you will need to provide a set of IRC relays for the bot to connect to; [1] a nick/pw pair; and set of channels to occupy. The default trigger prefix is !w. The nodetimeout setting corresponds to the interval in which a polled node must answer (or otherwise is declared 'busy'.)

nodes.txt is the list of btc nodes that will be polled when a 'poll' command is issued. Presently it contains several TRB nodes which I operate, as well as a few which the former are peering with. For example,


188.121.168.69 8333 unknown

If you want your Watchglass bot to identify a node's operator when issuing output, supply a name in place of the 'unknown' in the corresponding line in nodes.txt.

The provided start_bot.sh can be edited to match your directory layout, and placed into e.g. a @reboot cron job.

The routines of watchglass.py pertaining to the traditional btc protocol are found in the section marked 'BTC Node Interrogator'.

Those pertaining to IRC, are found in the section marked 'IRC Bot'.

An instance of Watchglass is currently operating in my IRC channel on Fleanode. If you would like your TRB node to be included in the polling roster, or would like to have the bot join your channel, please write in. Alternatively, you can use the program by running your own instance.



[1] See 'Logotron Genesis'. The same relay rotation and reconnection logic is used in this bot. The only major change is the addition of locking in the 'speak' routine, to make the bot thread-safe and enable the use of asynchronous threads for interrogating btc nodes.

[2] It is not difficult to add periodic silent polling / event reporting, in place of the manually-triggered polls. But I have not yet done this. Other potential improvements could include e.g. mempool search for a given transaction, network mapping, etc. There is a more or less complete general-purpose implementation of the traditional btc 'wire protocol' in Watchglass.

This entry was written by Stanislav , posted on Tuesday February 25 2020 , filed under Bitcoin, Cold Air, Computation, Friends, SoftwareArchaeology, SoftwareSucks . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

2 Responses to “"Watchglass" Genesis.”

  • billymg says:

    Thank you for this very useful tool, working with it has been quite pleasant.

    As mentioned in #asciilifeform I think the 'addr_me' and 'addr_you' fields in the version message payload are in the wrong order and should be flipped.

    I also noticed that watchglass_peers_cmd.kv.vpatch seems to be missing an update to the manifest file, although it does make note of the block height at publish time in the line that updates the version number.

    • Stanislav says:

      Dear billymg,

      You're welcome. Don't hesitate to link to your vpatches for this tool, if you happen to write some, I will mirror them here.

      Yours,
      -S

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" highlight="">


MANDATORY: Please prove that you are human:

27 xor 73 = ?

What is the serial baud rate of the FG device ?


Answer the riddle correctly before clicking "Submit", or comment will NOT appear! Not in moderation queue, NOWHERE!