A python service sending alerts via Telegram bot in case of either your node is offline or has missed a block.
- Your own Telegram bot with api token (create via @BotFather bot)
- Your own server with Python 3+, pip, virtualenv installed
Execute line by line in server terminal:
useradd -m minter-monitoring
chown -R minter-monitoring:minter-monitoring /home/minter-monitoring/
cd /home/minter-monitoring/
virtualenv venv
source venv/bin/activate
pip install python-telegram-bot==12.0.0b1
pip install git+https://github.com/U-node/minter-sdk git+https://github.com/Minterious/minter-monitoring
Create /home/minter-monitoring/config.json
file based on example.
You should customize the following parameters:
minter_api_url
- API url of a synced mainnet Minter nodeminter_nodes_pub_keys
- public keys of nodes to monitornode_pubkey
- mapping public key -> node nametelegram_bot_token
- Telegram Bot API access tokenmonitoring_auth_key
- can be any secret string to use as an alerts subscription key for your Telegram bot
Create service file like /etc/systemd/system/minter-monitoring.service
with the following content:
[Unit]
After=network.target
[Service]
Type=simple
User=minter-monitoring
ExecStart=/home/minter-monitoring/venv/bin/python /home/minter-monitoring/venv/lib/python3.6/site-packages/mintermonitoring/main.py /home/minter-monitoring/config.json
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
Alias=minter-monitoring.service
After running the service send /start {monitoring_auth_key}
message to bot to authorize yourself.
At this point you are done and will receive alerts via Telegram bot in case of either your node is offline or has missed a block