Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

threefoldtecharchive/tfgrid_monitoring_bot

Repository files navigation

tfgrid monitoring bot

Codacy Badge gopherbadger-tag-do-not-edit Testing Testing Dependabot

This is a bot to monitor the balance in accounts and send warnings if it is under some threshold. It also monitors the behavior of the rmb proxy

How to start

  • Create a new telegram bot if you don't have.
  • Create a new env file .env, for example:
TESTNET_MNEMONIC=<your mainnet mnemonic>
MAINNET_MNEMONIC=<your testnet mnemonic>
DEVNET_MNEMONIC=<your devnet mnemonic>
QANET_MNEMONIC=<your qanet mnemonic>
DEV_FARM_NAME=Freefarm
QA_FARM_NAME=Freefarm
MAIN_FARM_NAME=Freefarm
TEST_FARM_NAME=FreeFarm
BOT_TOKEN=<your token>
CHAT_ID=<your chat ID>
MINS=<number of minutes between each message>
  • Create a new json file wallets.json and add the list of addresses you want to monitor, for example:
{ 
    "testnet": [{ 
        "name": "<your wallet name>", 
        "address": "<your tfchain address>", 
        "threshold": 700 
    }],

    "mainnet": [{ 
        "name": "<your wallet name>", 
        "address": "<your tfchain address>", 
        "threshold": 700 
    }]
}
  • Get the binary

Download the latest from the releases page

  • Run the bot

After downloading the binary

sudo cp tfgrid_monitoring_bot /usr/local/bin
tfgrid_monitoring_bot -e .env -w wallets.json

Where

  • .env is the environment file
  • wallets.json is the json file of wallets to be monitored

Create a bot if you don't have

  • Open telegram app
  • Create a new bot
1. Find telegram bot named "@botfarther"
2. Type /newbot
  • Get the bot token
1. In the same bot named "@botfarther"
2. Type /token
3. Choose your bot
  • Get your chat ID
1. Search for @RawDataBot and select Telegram Bot Raw from the drop-down list.
2. In the json returned, you will find it in section message -> chat -> id

Test

make test

Release

  • Check goreleaser check
  • Create a tag git tag -a v1.0.6 -m "release v1.0.6"
  • Push the tag git push origin v1.0.6
  • the release workflow will release the tag automatically