diff --git a/README.md b/README.md index 5e7336f6..4517b949 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,16 @@

🔷 📊 Waves Nodes Monitoring

## Description -Incident reports, nodes' status, fork detection and many other features are available. Discord and Telegram bots are supported. -## Available commands +Incident reports, nodes' status, fork detection and many other features are available. Discord and Telegram bots are +supported. + +* [Main monitoring service](./cmd/nodemon/README.md) +* [Telegram bot](./cmd/bots/telegram/README.md) +* [Discord bot](./cmd/bots/discord/README.md) + +## Available bots commands + `/status` command shows the current state and heights of monitored nodes. `/add ` adds a new node to the list of those which are monitored @@ -20,19 +27,17 @@ Incident reports, nodes' status, fork detection and many other features are avai `/start` to start monitoring - - - ## Alerts All monitored nodes are being polled constantly. Thus, it is possible to be notified of any accident. Main alerts: - - `Height alert` is sent if the current height of one (or more) of the nodes is noticeably lower than other's - - - `State Hash alerts` is sent if one (or more) of the nodes handled a transaction differently - - - `Unreachable alert` is sent if one (or more) of the nodes are unavailable due to network disconnection or an internal error - - - Telegram bot, Discord bot and Monitoring services are different services, however the bots depend on the information which Monitoring service provides +- `Height alert` is sent if the current height of one (or more) of the nodes is noticeably lower than other's + +- `State Hash alerts` is sent if one (or more) of the nodes handled a transaction differently + +- `Unreachable alert` is sent if one (or more) of the nodes are unavailable due to network disconnection or an internal + error + +Telegram bot, Discord bot and Monitoring services are different services, however the bots depend on the information +which Monitoring service provides diff --git a/cmd/bots/discord/README.md b/cmd/bots/discord/README.md new file mode 100644 index 00000000..3f748d97 --- /dev/null +++ b/cmd/bots/discord/README.md @@ -0,0 +1,35 @@ +# Nodemon-discord - discord bot for `nodemon` monitoring service + +## Options / Configuration parameters + +Any option can be set in a CLI parameter or environment variable form. The CLI form has higher priority than +the environment variable form. +To set an option as a CLI parameter use _**kebab-case**_ option name. +To do the same as environment variable form use _**UPPER_SNAKE_CASE**_ option name. + +### List of supported options in kebab-case form + +- _-bind_ (string) — Local network address to bind the HTTP API of the service on. +- _-development_ (bool) — Development mode. It is used for zap logger. +- _-discord-bot-token_ (string) — The secret token used to authenticate the bot in Discord. +- _-discord-chat-id_ (string) — discord chat ID to send alerts through a specific chat +- _-log-level_ (string) — Logging level. Supported levels: DEBUG, INFO, WARN, ERROR, FATAL. Default logging level + is INFO. (default "INFO") +- _-nano-msg-pair-discord-url_ (string) — Nanomsg IPC URL for pair socket (default + "ipc:///tmp/nano-msg-nodemon-pair.ipc"). Used for communication between the monitoring and bot services. +- _-nano-msg-pubsub-url_ (string) — Nanomsg IPC URL for pubsub socket (default + "ipc:///tmp/discord/nano-msg-nodemon-pubsub.ipc"). Used by the bot to subscribe to alerts generated by + the monitoring service. + +## Build requirements + +- `Make` utility +- `Golang` toolchain + +## Docker + +To build docker image for this service execute these commands from **the root** of **the project**: + +```shell + docker build -t nodemon-discord -f ./Dockerfile-nodemon-discord . +``` diff --git a/cmd/bots/telegram/README.md b/cmd/bots/telegram/README.md new file mode 100644 index 00000000..86452744 --- /dev/null +++ b/cmd/bots/telegram/README.md @@ -0,0 +1,39 @@ +# Nodemon-telegram - telegram bot for `nodemon` monitoring service + +## Options / Configuration parameters + +Any option can be set in a CLI parameter or environment variable form. The CLI form has higher priority than +the environment variable form. +To set an option as a CLI parameter use _**kebab-case**_ option name. +To do the same as environment variable form use _**UPPER_SNAKE_CASE**_ option name. + +### List of supported options in kebab-case form + +- _-behavior_ (string) — Behavior is either webhook or polling (default "webhook"). Communication used between + Telegarm and the bot +- _-bind_ (string) — Local network address to bind the HTTP API of the service on. +- _-development_ (bool) — Development mode. It is used for zap logger. +- _-log-level_ (string) — Logging level. Supported levels: DEBUG, INFO, WARN, ERROR, FATAL. Default logging level + INFO. (default "INFO") +- _-nano-msg-pair-telegram-url_ (string) — Nanomsg IPC URL for pair socket (default "ipc: + ///tmp/nano-msg-nodemon-pair.ipc"). Used for communication between the monitoring and bot services. +- _-nano-msg-pubsub-url_ (string) — Nanomsg IPC URL for pubsub socket (default "ipc: + ///tmp/telegram/nano-msg-nodemon-pubsub.ipc"). Used by the bot to subscribe to alerts generated by + the monitoring service. +- _-public-url_ (string) — The public url (**for webhook only**) for Telegram to send events to the bot service. +- _-telegram-chat-id_ (int) — Telegram chat ID to send alerts through a specific chat. +- _-tg-bot-token_ (string) — The secret token used to authenticate the bot in Telegram. +- _-webhook-local-address_ (string) — The port (**for webhook only**) used for the webhook internal server (default ":8081") + +## Build requirements + +- `Make` utility +- `Golang` toolchain + +## Docker + +To build docker image for this service execute these commands from **the root** of **the project**: + +```shell + docker build -t nodemon-telegram -f ./Dockerfile-nodemon-telegram . +``` diff --git a/cmd/nodemon/README.md b/cmd/nodemon/README.md new file mode 100644 index 00000000..67d1713b --- /dev/null +++ b/cmd/nodemon/README.md @@ -0,0 +1,48 @@ +# Nodemon - main monitoring service + +## Options / Configuration parameters + +Any option can be set in a CLI parameter or environment variable form. The CLI form has higher priority than +the environment variable form. +To set an option as a CLI parameter use _**kebab-case**_ option name. +To do the same as environment variable form use _**UPPER_SNAKE_CASE**_ option name. + +### List of supported options in kebab-case form + +- _-api-read-timeout_ (duration) — HTTP API read timeout used by the monitoring API server. + Default value is 30s. (default 30s) +- _-base-target-threshold_ (int) — Base target threshold used for base target alerts. Must be specified. +- _-bind_ (string) — Local network address to bind the HTTP API of the service on. Default value is ":8080". (default ": + 8080") +- _-interval_ (duration) — Polling interval, seconds. Used for polling nodes for the analysis. + Default value is 60 (default 1m0s) +- _-development_ (bool) — Development mode. It is used for zap logger. +- _-log-level_ (string) — Logging level. Supported levels: DEBUG, INFO, WARN, ERROR, FATAL. Default logging level + INFO. (default "INFO") +- _-nano-msg-pair-discord-url_ (string) — Nanomsg IPC URL for pair socket. Used for communication with the discord bot. +- _-nano-msg-pair-telegram-url_ (string) — Nanomsg IPC URL for pair socket. Used for communication with the telegram bot. +- _-nano-msg-pubsub-url_ (string) — Nanomsg IPC URL for pubsub socket (default "ipc:///tmp/nano-msg-pubsub.ipc") +- _-nodes_ (string) — Initial list of Waves Blockchain nodes to monitor. Provide comma separated list of REST API URLs + here. +- _-retention_ (duration) — Events retention duration. Default value is 12h (default 12h0m0s) +- _-storage_ (string) — Path to nodes storage. Will be **ignored** if _-vault-address_ is set. (default ".nodes.json") +- _-timeout_ (duration) — Network timeout, seconds. Used by the poller to poll nodes with the timeout. + Default value is 15 (default 15s) +- _-vault-address_ (string) — Vault server address. +- _-vault-mount-path_ (string) — Vault mount path for nodemon nodes storage. (default "gonodemonitoring") +- _-vault-password_ (string) — Vault user's password. +- _-vault-secret-path_ (string) — Vault secret where nodemon nodes will be saved +- _-vault-user_ (string) — Vault user. + +## Build requirements + +- `Make` utility +- `Golang` toolchain + +## Docker + +To build docker image for this service execute these commands from **the root** of **the project**: + +```shell + docker build -t nodemon -f ./Dockerfile-nodemon . +```