This a fork from https://github.com/Ziltar/HOPR_Node_Notification. Great thanks to Ziltar!
Simple script to get the status of a node via Telegram.
This bot checks the availability of the node (or multiple nodes) every certain time and sends a notification about the status of the node(s). A notification can be sent always or only when the availability changes.
- Clone the repository :
git clone https://github.com/alpha7b/HOPR_Node_Notification.git && cd HOPR_Node_Notification
- Install requirements:
pip install -r requirements.txt
- Rename
setting.py_sample
tosetting.py
- Edit the settings.py File:
NODES: HOPR Node Address(es)
Example:
NODES = ["16Uiu2HAmH3RhgTDN6cwysRnMtMf4jfzsvKuyuKPu5iDRZUZiVsqx", "16Uiu2HAkuTsuFSak6UJeF2w3KV2uzoNSpuGNFKC2vyLt63BpwuDC"]
TELEGRAM_TOKEN
Example:TELEGRAM_TOKEN = "5475148206:ABBc0fhQSwfBjKioPwbaZ9uxEPkpsgqbgi"
You can get your token here: https://t.me/BotFather
TELEGRAM_ID
You can use a bot to find out your ID: https://t.me/userinfobot
Example:
TELEGRAM_ID = "15915301634711"
ON_CHANGE
If True, the bot sends a notification only when the availability changes (24 hours). If False, a notification is sent 30 minutes.
Example:ON_CHANGE = True
INTERVAL = '1800'
By default, the bot will check node status every 1800 seconds which is 30 minutes. You can change the interval. For example, change to 3600 seconds.
Example:INTERVAL = '3600'
ON_REWARD_CHANGE
If True, the bot sends a notification when reward changes.
Example:ON_REWARD_CHANGE = True
STAKE_WALLETS: For reward status:
Example:
STAKE_WALLETS = ["0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000001"]
Run main.py: python3 main.py
You can also run it in a screen session.
screen -r hoprd-monitor
python3 main.py
CTRL + A + D to detach the screen