Tech:Mina Monitor v2.0 presentation

Mina Monitor is a tool designed for the convenient monitoring of a Mina nodes. Built by Ukranian developer Serhii Pimenov on 5th October a new version, Mina Monitor v2.0 was released. The new release transforms the Monitor to the next level:

New updates include

  • change of the exchange protocol from HTTP(s) to WebSocket.
  • rewrite of Server to use a stored node state, and now Server sends changes to clients only when the state data changes.
  • added the ability to change config parameters when the Mina Monitor Server starts, without changing a config file, and only for the current session.
  • added a special format for defining time slots and intervals
  • significantly reduced the number of parameters for the Client and Cluster.
  • added Docker support and created Docker images for the Client, Server, and Cluster.
  • added one-line installation scripts to simplify installing Client, Server, and Cluster.
  • To Cluster, more data to display added.

Here are the updates in more detail, from Serhii Pimenov’s notes.

WebSocket and stored state

One of the community members, Alexander Nikiforov, pushed me to change the communication protocol between the client and the server from HTTP to WebSocket. This change significantly reduced overhead costs for both the client and the server. Now you can run a lot of clients without significant server load. This is facilitated by the use of the saved state of the node.

Change parameters when Server start

Now you can change different config parameters when Server started without really changing the config file, only for the current session.

To override the values, you need to follow the following rules: 

  • overridden parameters must go after the main command to start the server
  • parameters are defined as a key-value pair with a space delimiter
  • the key must begin with a hyphen. If the key is compound, it must be separated by a colon
  • if value contains spaces, you must enclose the value in quotes
  • if a value is an array, you must define it as a string with commas as delimiter

For example:

node index \ 

    -memAlert 80 \ 

    -price:currency eur \

    -alertToDiscord “HELLO, BALANCE”

Special format for defining time slots and intervals

Some parameters are such, which determine time slots. For example at what interval the status of the node will be requested or at what interval the current balance of the address will be sent.

For the Monitor I created two ways for defining time slots:

  1. The first way – you can set an interval in milliseconds. To define the interval in milliseconds, you must correctly calculate this value. For example, if you need to create an interval in 5 minutes, you must multiply 1000 ms by 60 sec and multiply it by 5 minutes, and this result, 300 000 (three hundred thousand)  ms, is defined as a parameter value.
  2. The second way – to use a string value in the special format. This way implies that the interval can contain up to 4 parts, namely the number of days, hours, minutes, and seconds. Each part represents a structure that contains a numeric value and part label, for days – letter d, for hours – h, for minutes – m, and for the seconds – s. For example, to define the interval in 5 minutes, just write “5m”. For example, to define a value for 1 day 23 minutes 13 seconds, just write “1d 23m 13s” instead of  87 793 000 (eighty-seven million seven hundred and ninety-three thousand) in milliseconds. 

For example:

You can define a parameter as

“restartAfterNotSynced”: “30m”

Instead of

“restartAfterNotSynced”: “1800000”

Reduced the number of parameters for the Clients

The transition to WebSockets made it possible to abandon the configuration parameters for the Client and Cluster that determine the time intervals for requesting data from the server. Since the server sends the data itself to the clients when they have changed.

Docker support

I added Docker files and created Docker images for the Client, Server, and Cluster. You can find these images on my DockerHub repository by URL https://hub.docker.com/u/olton

One-line install

To simplify life for the regular users, who are not programmers or system admin or power users, I created special scripts for installing Client, Server, and Cluster by one-line command.

For example, to install a Server, you need to execute a command:

curl -s https://raw.githubusercontent.com/olton/scripts/master/mina/monitor/server/install.sh | bash

All scripts you can find in my GitHub repository https://github.com/olton/scripts

And lastly

The cluster now shows even more useful information, such as supercharged blocks and zero-win blocks.


Disclaimer
We are not qualified brokers/dealers, or investment advisors. This website and its associated content is not a service for the giving or receiving of financial or investment advice. None of the content constitutes – or should be understood as constituting – a recommendation to enter in any securities, cryptocurrency, or cryptoasset transactions or to engage in any of the investment strategies presented in my discussions or content provided. We do not provide personalised recommendations or views as to whether a stock, cryptocurrency, cryptoasset or investment approach is suited to the financial needs of a specific individual.

Leave a Reply