An AI-powered self-monitoring agent designed to predict, analyze, and mitigate risks that could cause missed blocks for validator nodes.
- Collects live system metrics (CPU load, memory, disk IO, network errors) using Prometheus
- Predicts probability of system failure using a trained machine learning model (Gradient Boosted Trees)
- Detects real anomalies (high CPU, low memory, high IO, etc.)
- Automatically mitigates issues safely when possible (e.g., clearing memory cache)
- Sends real-time Telegram alerts if a critical threshold is crossed
- Retrains itself over time based on collected real-world data
- Runs as a lightweight daemon without interfering with your validator performance
git clone https://github.com/GlibxNodes/GlibxNodesAIBot.git
cd GlibxNodesAIBotpip install -r requirements.txtrequirements.txt contains:
prometheus-api-client,scikit-learn,pandas,python-dotenv,requests,joblib
Create a .env file in the root directory:
PROMETHEUS_URL=http://localhost:9090
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
TELEGRAM_CHAT_ID=your-chat-id📌 Notes:
- Get your Telegram Bot Token from @BotFather
- Find your Chat ID from @userinfobot
To run manually:
python3 validator-ai.pyOr run as a systemd service:
sudo systemctl start validator-ai
sudo systemctl enable validator-ai| Metric | Purpose |
|---|---|
node_load1 |
CPU system load |
node_memory_MemAvailable_bytes |
Free memory |
node_disk_io_time_seconds_total |
Disk I/O pressure |
node_network_receive_errs_total |
Network errors |
- CPU load > 5.0 (sustained)
- Available memory < 1GB
- Disk I/O overload
- Rising network errors
- AI-detected anomalies
- Memory cache clearing (
sync; echo 3 > /proc/sys/vm/drop_caches) - Process priority adjustment
- Zombie process cleanup (future planned)
- ✅ Current system metrics snapshot
⚠️ Detected primary issue- 🛠️ Suggested recommended actions
- 🔧 Mitigations applied (if any)
- Only safe, read-only system interventions (no validator force restarts)
- Minimal resource usage (~30MB RAM)
- Self-learning model that improves over time
- Always fallback to safe prediction mode if needed
flowchart TD
A[Start Monitoring] --> B{Risk Detected?}
B -- No --> A
B -- Yes --> C{Real Anomaly?}
C -- No --> A
C -- Yes --> D[Send Telegram Alert]
D --> E{Can Auto-Mitigation Help?}
E -- No --> A
E -- Yes --> F[Run Safe Mitigation]
F --> A
