Skip to content

feat: Miner Alert System (Bounty #28)#1437

Merged
Scottcjn merged 1 commit intoScottcjn:mainfrom
mtarcure:feat/miner-alerts-bounty-28
Mar 16, 2026
Merged

feat: Miner Alert System (Bounty #28)#1437
Scottcjn merged 1 commit intoScottcjn:mainfrom
mtarcure:feat/miner-alerts-bounty-28

Conversation

@mtarcure
Copy link
Contributor

Summary

Python monitoring service for RustChain miners. Polls the API and fires alerts via email (SMTP) or SMS (Twilio).

  • Miner Offline — No attestation within configurable threshold
  • Attestation Failure — Stale attestation timestamp across consecutive polls
  • Rewards Received — Balance increased above minimum threshold
  • Large Transfer — Balance dropped by configurable amount
  • Back Online — Recovery notification after offline alert

Features

  • Async httpx client with Pydantic models for all API responses
  • SQLite persistence for miner state tracking and alert deduplication
  • YAML config with env var overrides for secrets (SMTP_PASSWORD, TWILIO_AUTH_TOKEN)
  • CLI: python -m rustchain_alerts with --once (cron-friendly) and --history modes
  • 25 tests passing (monitor logic, config loading, DB operations)

Files

All files in monitoring/alerts/:

  • rustchain_alerts/ — Python package (api, config, db, monitor, notifiers)
  • tests/ — 25 pytest tests
  • config.yaml — Template configuration
  • README.md — Setup and usage documentation
  • requirements.txt — Dependencies

Test plan

  • All 25 unit tests pass (pytest tests/ -v)
  • Config loads from YAML with env var overrides
  • Offline detection fires at threshold, deduplicates, clears on recovery
  • Balance change detection for rewards and large transfers
  • Attestation failure detection on stale timestamps

Closes #28

Python monitoring service that polls RustChain API and sends alerts for:
- Miner offline (no attestation within threshold)
- Attestation failures (stale timestamps)
- Rewards received (balance increase)
- Large transfers (balance drop)

Includes SMTP email and Twilio SMS notification backends, SQLite
persistence for state tracking and alert deduplication, YAML config
with env var overrides for secrets, CLI with --once and --history modes.

25 tests passing.

Closes Scottcjn#28
@mtarcure
Copy link
Contributor Author

Wallet for payout: wirework

@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) api API endpoint related size/XL PR: 500+ lines labels Mar 16, 2026
Jesse-Voo pushed a commit to Jesse-Voo/Rustchain that referenced this pull request Mar 16, 2026
…cjn#28)

Generated by AI bounty hunter
Payment: 0x4F666e7b4F63637223625FD4e9Ace6055fD6a847
Jesse-Voo pushed a commit to Jesse-Voo/Rustchain that referenced this pull request Mar 16, 2026
…lert System (Bounty Scottcjn#28)

Generated by AI bounty hunter
Payment: 0x4F666e7b4F63637223625FD4e9Ace6055fD6a847
Jesse-Voo pushed a commit to Jesse-Voo/Rustchain that referenced this pull request Mar 16, 2026
…ttcjn#1437: feat: Miner Alert System (Bounty Scottcjn#28)

Generated by AI bounty hunter
Payment: 0x4F666e7b4F63637223625FD4e9Ace6055fD6a847
@Scottcjn Scottcjn merged commit a4a7e60 into Scottcjn:main Mar 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API endpoint related BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation 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)

2 participants