Skip to content

With this repository, you can create a telegram bot and monitor you resources of your smart contract. Get autmatic notifications on a channel you set up via the bot if resources run low.

License

Notifications You must be signed in to change notification settings

oboluscrypto/eos-dapp-resource-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EOS Dapp Resource Monitoring and Alert (Telegram Bot)

With this repository, you can create a Telegram bot and monitor you resources of your smart contract. Get autmatic notifications on a channel you set up via the bot if resources run low.

Screenshot

Requirements

Python 3.6+

pip install -r requirements.txt

Set up telegram

Create the bot

This is super easy, talk to the botfather bot and let him create a bot for you. Be sure to note the token it gives you. More info. The token looks like 123456789:ZIUHDFIUHAIUFuqushfuia4UA1.

Add bot to channel and get channel id

Make a group for your alerts. Add the bot via its name. Once done, you can find the chat id by going to this link in your browser: https://api.telegram.org/bot123456789:ZIUHDFIUHAIUFuqushfuia4UA1/getUpdates (replace the token).

Check for the channel it was just added to and you'll see the id, something like -11321241.

Setup this app

In ./configs folder, copy the sample file to eos-monitor.json. Fill the three required files with token, chat id, and EOS account name to monitor. If the contract is on mainnet, make sure you pick up a node that is connected to mainnet.

Limits

In the config file there are limits set. A warning will appear if you used resources in per cent (%) go above that limit.

Another message will appear in the chat if the resources drop below. Feel free to adjust the python code as necessary to your needs.

Run

# Daemonise or simply run
python telegram.py

About

With this repository, you can create a telegram bot and monitor you resources of your smart contract. Get autmatic notifications on a channel you set up via the bot if resources run low.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages