The Contract Monitor Bot is a tool designed to monitor user contracts within ThreeFold Grid.
Features:
- Monitors user contracts and nodes status.
- Customizable alerting and notification system.
Ensure that you have installed:
- Go programming language (version 1.19 or higher if not using docker)
- Git
- Clone this repository to your local machine:
git clone https://github.com/threefoldtech/tfgrid-sdk-go.git
cd tfgrid-sdk-go/user-contracts-mon
- Setup your telegram bot and your env
- Create a new telegram bot if you don't have.
- Create a new env file
.env
, for example:
BOT_TOKEN=<your bot token>
INTERVAL=<number of hours between notifications>
```
3. Run the bot:
- Using go
```bash
go run main.go -e .env
```
- Using Docker
```bash
docker build -t contract-mon -f Dockerfile ../
docker run -v $(pwd)/.env:/.env -it contract-mon -e /.env
```
## Create a bot
- Open telegram app
- Create a new bot
```ordered
1. Find telegram bot named "@botfarther"
2. Type /newbot
```
- Get the bot token
```ordered
1. In the same bot named "@botfarther"
2. Type /token
3. Choose your bot
```