Skip to content

Mina Monitor v2.1.0

Compare
Choose a tag to compare
@olton olton released this 22 Dec 17:36
· 32 commits to master since this release

Changelog for 2.1.0

  • Server: added interaction with a block height from Mina Explorer
  • Server: added interaction with the latest block from Mina Explorer
  • Server: changed config for telegram and discord definition, updated functions for sending alerts and price
  • Server: removed config parameters telegramToken, telegramChatID, telegramChatIDAlert, discordWebHook
  • Server: added config parameters telegram, discord
  • Server: added config options for telegram: token, tokenInfo, tokenAlert, chatIDInfo, chatIDAlert
  • Server: added config options for discord: webhook, webhookInfo, webhookAlert, botName
  • Server: to config parameters alertToTelegram, alertToDiscrod added value PRICE. Parameter price:targets deprecated
  • Server: to config parameters alertToTelegram, alertToDiscrod added value REWARDS
  • Server: to config parameters alertToTelegram, alertToDiscrod added value UPTIME
  • Server: removed config parameter balanceSendInterval
  • Server: added config parameter channel:info to define which alerts will send to the info channel
  • Server: changed reconnect interval to comparable node from 1s to 30s
  • Server: changed parameter comparison. Now this parameter has a new structure
  • Server: added response for Monitor Version
  • Server: added watcher for config file
  • Server: config parameters memAlert, memRestart deprecated. You must use new parameters: memory:alert, memory:restart
  • Server: config parameters hangIntervalAlert, hangInterval deprecated. You must use new parameters: hang:alert, hang:restart
  • Server: added response about server start mode https with value true or false
  • Server: added support for static files for webserver
  • Server: added config parameter webRoot. With this parameter you can set a webRoot folder other than default (the same where the monitor is installed)

What’s new in 2.1.0

  • In the new version returned interaction with a Mina Explorer. Now, Monitor sends a request to the Mina Explorer for information about the last canonical block and blockchain height.
  • Changes have been made to the config file structure to make it clearer, and to support new features. I changed parameters which respond to interaction with messengers (Discord and Telegram), interaction with others nodes where Monitor installed (comparison nodes), parameters, which defines a behavior of the Monitor for control memory usage and node hanging state.
  • Added new usefulness messages to messengers about won blocks, about uptime changes in the leaderboard.
  • Changed algorithm sending information about balance state. Now, information is sent only when the balance was changed. So, parameter balanceSendInterval deprecated, and for enabling balance state sending you must add value BALANCE to the alertToTelegram or alertToDiscord.
  • Added a special observer for config file changing. Now, if you change a config.json file content, Monitor applies new values on the fly.
  • Now, the server sends the protocol mode (HTTP or HTTPS) to the clients, and this mode is displayed as a closed lock on the left corner in each node panel (in Cluster client).
  • Added support for using additional static HTML files in an internal web-server.

Interaction with Mina Explorer

For Interaction with Mina Explorer a special module was added. You can control this module with a composite parameter explorer.

{
        "explorer": {
            "getRewardsInterval": "3m",
            "getLatestBlocksInterval": "1m",
            "getBlockchainSummaryInterval": "1m"
        }
}

Параметры:

  • getRewardsInterval - this key responsible for how often Monitor will ask information about won blocks in current epoch.
  • getLatestBlocksInterval - this key responsible for how often Monitor will ask information about the latest canonical block in blockchain.
  • getBlockchainSummaryInterval - this key responsible for how often Monitor will ask blockchain summary info.

Changing in alert system

Parameters responsible for organization information users to Telegram and/or to Discord were reorganized for simplification and clearing from one side, and for ability to control new features. The next parameters were deprecated: telegramToken, telegramChatID, telegramChatIDAlert`, discordWebHook. Added composite parameters instead telegram and discord. Also was added parameter channel:info for defining messages, which Monitor sends to INFO channel, others messages Monitor will send to ALERT channel. Now, you can divide messages between INFO and ALERT channels and send them to different chats.

telegram

{
    “telegram”: {
        “token”: “”,
        “tokenInfo”: “”,
        “tokenAlert”: “”,
        “chatIDInfo”: “”,
        “chatIDAlert”: “”
    }
}

discord

{
    “discord”: {
        “webhook”: “”,
        “webhookInfo”: “”,
        “webhookAlert”: “”,
        “botName”: “”
    }
}

channel

{
    “channel”: {
        “info”: ["HELLO", "BALANCE", "PRICE", "REWARDS", "UPTIME"]
    }
}

Messages types

    const defaultAlerts = [
        "FAIL",
        "EXEC",
        "HELLO",
        "STATUS",
        "MAX",
        "FORWARD-MAX",
        "FORK",
        "FORWARD-FORK",
        "HANG",
        "EXPLORER",
        "RESTART",
        "BALANCE",
        "PEERS",
        "MEM",
        "COMPARE",
        "PRICE",
        "REWARDS",
        "UPTIME"
    ]

Channel defining

Starting from Monitor 2.1.0 you can use one or two different channels (one for INFO messages, and one for ALERTS) for sending messages from Monitor. If you are only going to use one channel, you can define Telegram token in key token in parameter telegram, and Discord chat webhook in key webhook in parameter discord. If you wish to use different channels, you can define values for keys tokenInfo, tokenAlert, webhookInfo, and webhookAlert. Also, for sending messages to Telegram, you must define users IDs in keys chatIDInfo and/or chatIDAlert. If you wish to send and info messages and alerts to the user, you must put the user chat id to both keys or use merging key chatID.

Split messages to different types

You can split messages to two different types: info and alert. For this purpose you can use parameter channel:info. In the key info of the parameter channel, you must define those messages that are delivered into the info channel. Other messages the Monitor will send to the alert channel. By default, this key contains the following values: "HELLO", "BALANCE", "PRICE", "REWARDS", "UPTIME".

Control the Node hanging state

For a more convenient and understandable perception of the parameters responsible for the behavior of the Monitor in the event of a node hanging detection, next parameter were deprecated hangIntervalAlert, hangInterval. To set Monitor behavior you must use a composite parameter hang with keys alert and restart.

{
    “hang”: {
        “alert”: “30m”,
        “restart”: “60m”
    }
}

Control memory usage

For a more convenient and understandable perception of the parameters responsible for the behavior of the Monitor in the event of a node memory usage detection, next parameter were deprecated memAlert, memRestart. To set Monitor behavior, you must use a composite parameter memory with keys alert and restart.

{
    “memory”: {
        “alert”: 95,
        “restart”: 0
    }
}

Interaction with others Mina Monitors

Beginning from version 2.0.2 Monitor receives a module for interaction with other Mina Monitor instances. This module can control matching block heights and inform you in case when height is different. In 2.1.0 the structure of parameters for this module was changed to:

{
    "comparison": {
        "reconnect": "30s",
        "blockDiff": 3,
        "nodes": [
            {
                "name": "Host1",
                "address": "host1.com:8000",
                “https”: false
            },
            {
                "name": "Host2",
                "address": "host2.com:8000",
                “https”: false
            }
        ]
    }
}

Attention! Interaction with other nodes may work incorrectly or not work at all if you have self-signed certificates installed or ssl certificates are installed incorrectly (incomplete chains, ...).

New messages

In 2.1.0 new information messages: 1) info about won blocks, 2) changes for your address in uptime leaderboard, 3) information about Mina cost. To activate these messages, you must add values PRICE, UPTIME, REWARDS to the parameter alertToTelegram and/or to the parameter alertToDiscord.

Note: it is necessary to take into account that the price:target parameter is canceled.

Config file watcher

In 2.1.0 added a module that monitors the state of the configuration file (config.json) and if any changes are made to it, this module applies these changes to the Monitor. With this, you no longer need to restart the monitor. You can change any parameter without restarting the Monitor, except for the parameters host, https, journal.

This functionality does not work yet with a Monitor running as a Docker Container.

HTTP or HTTPS

Now Monitor sends to clients information about protocol where he works. If the Monitor was started in secure mode (with using SSL certificate on HTTPS protocol), On the client (supported only in Cluster Client) you can see that on the top left corner on the node panel.

Supports static HTML files

In 2.1.0 was added support for using static html files on the level of the internal web server. You can control a place of the web server root folder with a parameter webRoot. You can use this feature to create and renew Let’s Encrypt certificate in automatic mode (if you use 80/443 ports to start Monitor).