Skip to content

Commit

Permalink
Services simple docs (#210)
Browse files Browse the repository at this point in the history
* Add simple documentation.

* Add references to the services docs in 'README.md'.

* Added a parameter in nodemon/readme and edited readmes

---------

Co-authored-by: esuwu <[email protected]>
  • Loading branch information
nickeskov and esuwu authored Sep 20, 2023
1 parent 0b8a9f9 commit a25d1fc
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 13 deletions.
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<h1 align="center">🔷 📊 Waves Nodes Monitoring</h1>

## 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 <node_url>` adds a new node to the list of those which are monitored
Expand All @@ -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
35 changes: 35 additions & 0 deletions cmd/bots/discord/README.md
Original file line number Diff line number Diff line change
@@ -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 .
```
39 changes: 39 additions & 0 deletions cmd/bots/telegram/README.md
Original file line number Diff line number Diff line change
@@ -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 .
```
48 changes: 48 additions & 0 deletions cmd/nodemon/README.md
Original file line number Diff line number Diff line change
@@ -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 .
```

0 comments on commit a25d1fc

Please sign in to comment.