-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): reshape agent bot notifications guide to make it generic
- Loading branch information
Showing
2 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
sidebar_position: 7 | ||
slug: agent-bot-notifications | ||
title: Agent Bot Notifications | ||
description: Learn how to set up agent bot notifications for FAssets. | ||
tags: [intermediate, fassets, bitcoin, dogecoin] | ||
authors: [fassko] | ||
keywords: [fassets, xrp, btc, doge flare-network, flare-network] | ||
--- | ||
|
||
The agent bot can send notifications to a Telegram bot or API endpoint. | ||
It helps monitor the health of the agent and the network. | ||
|
||
## Agent Bot Notifications Configuration | ||
|
||
1. Add the following configuration to the `apiNotifierConfigs` list in the `config.json` file: | ||
|
||
```json | ||
{ | ||
"apiKey": "API_KEY", | ||
"apiUrl": "NOTIFICATIONS_API_URL", | ||
"level": "danger" | ||
} | ||
``` | ||
|
||
2. The `apiKey` is sent in the header under `x-apikey`. | ||
The `level` field specifies the minimum level of alerts to send. | ||
If the `level` field is omitted, the bot will default it to `danger`. | ||
|
||
3. The `apiUrl` field specifies the URL to send the notifications to. | ||
The bot will send the notifications as POST requests to the `/api/agent/botAlert` endpoint. | ||
|
||
4. The agent bot can send notifications as POST requests to the endpoint `apiUrl/api/agent/botAlert` with the following body: | ||
|
||
```typescript | ||
PostAlert = { | ||
bot_type: string, | ||
address: string, | ||
level: string, | ||
title: string, | ||
description: string, | ||
}; | ||
``` | ||
|
||
## Telegram Notifications Alert Configuration | ||
|
||
1. Get the API key from the [FAssets Telegram Bot](http://t.me/FlareFAssetsSongbirdBot) by sending `/events` and selecting `Subscribe to Events`. | ||
2. Add the following configuration to the `apiNotifierConfigs` list in the `config.json` file, replacing `API_KEY` with the key obtained from the bot. | ||
|
||
```json | ||
{ | ||
"apiKey": "API_KEY", | ||
"apiUrl": "https://fasset-tg-bot-songbird.flare.network", | ||
"level": "danger" | ||
} | ||
``` | ||
|
||
Notifications will only be sent out for `danger` and `critical` levels, regardless of the configured level. | ||
This is enforced by the Telegram bot, which ignores other events to prevent unnecessary HTTP requests. |
This file was deleted.
Oops, something went wrong.