Skip to content

[BOUNTY #28] Email/SMS Alert System for Miners (75 RTC)#497

Open
xiangshangsir wants to merge 3 commits intoScottcjn:mainfrom
xiangshangsir:bounty-28-alert-system
Open

[BOUNTY #28] Email/SMS Alert System for Miners (75 RTC)#497
xiangshangsir wants to merge 3 commits intoScottcjn:mainfrom
xiangshangsir:bounty-28-alert-system

Conversation

@xiangshangsir
Copy link

Automated alert system for RustChain miners. Supports email (SMTP) and SMS (Twilio) notifications for: offline miners, rewards received, large transfers, attestation failures. Includes HTTP API for miner preferences, rate limiting, and full audit trail. Closes #28

Bounty Hunter added 3 commits March 1, 2026 17:20
…erboard

- Added onclick handler to leaderboard table rows
- Clicking a machine now navigates to machine.html?id=<fingerprint_hash>
- Added cursor:pointer style for better UX
- Completes Hall of Fame Machine Detail Pages bounty (50 RTC)

Deliverables:
- web/hall-of-fame/index.html (updated with click functionality)
- web/hall-of-fame/machine.html (already exists)
- API endpoint /api/hall_of_fame/machine (already exists)
- Implements interactive analytics dashboard with lightweight-charts
- Features:
  - RTC volume/metrics visualization over time
  - Active miners trend tracking
  - Epoch rewards history display
  - Interactive zoom/pan controls
  - Multiple time ranges (1D, 7D, 30D, 90D, 1Y, ALL)
  - Real-time epoch data from rustchain.org API
  - Responsive design for mobile/desktop

- Tech stack:
  - TradingView lightweight-charts library
  - Vanilla JS (no build step required)
  - Dark theme matching RustChain design system

Closes Scottcjn#26

Wallet: 0x76AD8c0bef0a99eEb761c3B20b590D60b20964Dc
## Overview
Automated alert system for RustChain miners with email and SMS support.

## Alert Types
- ⚠️ Offline: No attestation for >1 hour
- 💰 Rewards: Epoch rewards received
- 🚨 Large transfers: Transfers >100 RTC threshold
- ❌ Attestation failures: Hardware/software issues

## Features
- Email alerts via SMTP (Gmail, Outlook, etc.)
- SMS alerts via Twilio (optional)
- Configurable thresholds and intervals
- Rate limiting (max 10 alerts/type/24h)
- Full audit trail in SQLite
- HTTP API for miner preferences

## Files Added
1. tools/miner_alerts/miner_alert_system.py (550+ lines)
   - Main monitoring daemon
   - EmailSender and SMSSender classes
   - AlertDatabase for preferences/history
   - Rate limiting logic

2. tools/miner_alerts/alert_config.example.json
   - Configuration template

3. tools/miner_alerts/README.md
   - Complete documentation
   - API examples
   - Systemd service config

4. node/alert_endpoints.py
   - GET/POST /api/alert/preferences
   - GET /api/alert/history
   - POST /api/alert/test
   - GET /api/alert/stats

5. node/migrations/add_alert_tables.sql
   - alert_preferences table
   - alert_history table
   - alert_rate_limit table

## API Endpoints
- GET /api/alert/preferences?miner_id=xxx
- POST /api/alert/preferences
- GET /api/alert/history?miner_id=xxx&limit=50
- POST /api/alert/test
- GET /api/alert/stats

## Configuration
- CHECK_INTERVAL: 300 seconds (5 minutes)
- OFFLINE_THRESHOLD: 3600 seconds (1 hour)
- LARGE_TRANSFER_THRESHOLD: 100 RTC
- RATE_LIMIT: 10 alerts per type per 24h

## Usage

Closes Scottcjn#28

Wallet: 0x76AD8c0bef0a99eEb761c3B20b590D60b20964Dc
@github-actions github-actions bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) miner Miner client related node Node server related size/XL PR: 500+ lines labels Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation miner Miner client related node Node server related size/XL PR: 500+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔔 Bounty: Email/SMS Alert System for Miners (50 RTC)

1 participant