# redstone-monitoring

> This project consists of scripts and tools for monitoring of Redstone infrastructure

Latest version **0.3.6** (published 2023-11-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install redstone-monitoring
pnpm add redstone-monitoring
yarn add redstone-monitoring
bun add redstone-monitoring
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.6 |
| Published | 2023-11-07 |
| First published | 2023-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 137.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | redstone-finance |

## Links

- npm: https://www.npmjs.com/package/redstone-monitoring
- npm.io page: https://npm.io/package/redstone-monitoring

## Dependencies (14)

- [zod](https://npm.io/package/zod.md) ^3.22.2
- [axios](https://npm.io/package/axios.md) ^1.5.1
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.9
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [ignore](https://npm.io/package/ignore.md) ^5.2.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [mongodb](https://npm.io/package/mongodb.md) ^5.9.0
- [redstone-api](https://npm.io/package/redstone-api.md) ^0.4.11
- [@redstone-finance/sdk](https://npm.io/package/@redstone-finance/sdk.md) ^0.3.6
- [@redstone-finance/utils](https://npm.io/package/@redstone-finance/utils.md) ^0.3.6
- [@redstone-finance/protocol](https://npm.io/package/@redstone-finance/protocol.md) ^0.3.6
- [@redstone-finance/evm-connector](https://npm.io/package/@redstone-finance/evm-connector.md) ^0.3.6
- [@redstone-finance/rpc-providers](https://npm.io/package/@redstone-finance/rpc-providers.md) ^0.3.6
- [@redstone-finance/oracles-smartweave-contracts](https://npm.io/package/@redstone-finance/oracles-smartweave-contracts.md) ^0.3.6

## Recent versions

- 0.3.6 (latest) — 2023-11-07
- 0.3.5 — 2023-11-06

## README

# Redstone monitoring

This project consists of scripts and tools for monitoring of Redstone infrastructure

## How to use it

### 1. Prepare env variables

You can find sample env variable in the [.env.example](.env.example) file.

| Param                        |                                                          Description                                                           |
| ---------------------------- | :----------------------------------------------------------------------------------------------------------------------------: |
| ORACLE_GATEWAYS_URLS         |                      JSON string with array of gateway urls. It will be used for testing prod data feeds                       |
| MAIN_REMOTE_CONFIG_URL       |                                           URL for main remote monitoring configuration.                                        |
| REMOTE_CONFIG_BACKUP_URL     |                                        Backup URL for remote monitoring configuration.                                         |
| UPTIME_KUMA_URL_FOR_FAILURES |                                  Uptime kuma push URL that should be called in case of errors                                  |
| UPTIME_KUMA_URL_FOR_PING     | Uptime kuma URL that should be called on each test iteration. It is used to monitor if the monitoring service is still working |
| TG_CHAT_ID                   |                                            Telegram Chat Id for sending failed logs                                            |
| TG_BOT_TOKEN                 |                                           Telegram Bot Token for sending failed logs                                           |
| INSTI_1_SUBNET_RPC_URL       |                                              RPC URL for Insti-1 Avalanche subnet                                              |

#### How to prepare uptime-kuma URLs

We assume that you already have [uptime-kuma instance launched](https://github.com/louislam/uptime-kuma#-how-to-install).

1. To obtain an `uptime-kuma url for ping` you should create a new monitor of type `push`
2. To obtain an `uptime-kuma url for failures` you should create a new monitor of type `push` and **enable the `Upside Down Mode`**. Please Note: to trigger an error in this monitor you need to send a request to the obtained Push URL with `up` status.

#### How to prepare telegram env variables

1. [Create a new bot](https://core.telegram.org/bots/tutorial). After creating a bot you will have the bot token.
2. Create a new **telegram channel** (not a group). Invite your bot there as an admin. Send a message to the channel and use the following URL to obtain the chat id: `https://api.telegram.org/bot${YOUR_BOT_TOKEN}/getUpdates`

### 2. Run it

To run tests with 5s interval you can use the following command

```sh
bash shell-scripts/run-tests-in-loop.sh 5
```

---
_Source: https://npm.io/package/redstone-monitoring · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
