The purpose of this bot is to provide optional console output and/or remote (SMS, webhooks, SMTP, etc.) messaging output that can be used to notify rippled server operators of issues including state changes and forks.
This bot is designed to subscribe to the server
, ledger
, and validation
streams from multiple rippled servers. It can thus be used to monitor both stock (directly) and validating (indirectly) nodes.
Monitoring can be done by observing the console output and/or subscribing to notifications via Twilio (SMS), Mattermost, Discord, Slack, and/or SMTP.
Specify stock (non-validating) servers you wish to directly connect to via websocket in the SERVERS
section of settings.py
.
Specify validating nodes' master or ephemeral validation keys in the appropriate settings.py
section. Validations from these servers will be sourced from the specified SERVERS
in settings.py
.
As this tool is used to monitor the live network, it is not really useful for monitoring reporting mode/Clio servers.
This is an early stage project, so expect problems. This monitoring tool is not intended for solo use in a production environment - please use redundant monitoring for mission-critical infrastructure. No one who contributed to this code is responsible for your servers.
By running this code, you agree the code author(s) are not liable for missed notifications or other issues, including, but not limited to, those arising from errors in the code.
Be cautious when using webhooks, as messages may be lost due to rate limiting or other factors.
- Attempt to reconnect to servers that stop sending new last_ledger index numbers.
- Send an admin warning if >50% of servers stop advancing.
- Integrate with sqlite DBs to retrieve server, validator, and notification data.
- Retry sending messages that fail (by piping them back into the queue).
- Support Slack & email notifications.
- Notify validator subscribers if their ephemeral key changes.
- Write a function to scrub sensitive notification data from logging.
- Account for rippled errors, like tooBusy.
If enabled in settings.py
, notifications will be sent at the following times:
- When a server disconnects and/or reconnects
- When the state for a subscribed server changes
- When a subscribed server or a monitored validator is more than n ledgers (specified in
settings.py
) ahead of or behind the rest of the network - (coming later) When latency is dangerously high between monitoring bot and the remote server
- Administrators can receive heartbeat messages as specified in
settings.py
- (coming later) When a validator changes their amendment votes
At this time, notifications will not be retried if the monitoring server is unable to reach the API. This functionality can be easily integrated in the future by passing the messages back into the notification_queue.
As written, this code will produce errors with asyncio in Python 3.9. The code is tested and works with 3.10 and 3.11.
git clone https://github.com/jscottbranson/rippled-livenet-monitor.git
cd rippled-livenet-monitor
pip install -r requirements.txt
cp settings_ex.py settings.py
- Adjust
settings.py
- (optional) Save Twilio notification credentials as env variables.
python3 main.py
The utils_for_humans
directory contains a dict_convert.py
script that can be used to assist in generating a configuration file with monitoring output that is consistent across all servers.
cd rippled_monitor
git pull
- This project is early stage, so it's important to check for new settings in
settings_ex.py
after updating.