Skip to content

Add Miner Dashboard - Personal stats and reward tracking (#501) - #796

Merged
Scottcjn merged 1 commit into
Scottcjn:mainfrom
waterwater123:feature/miner-dashboard-501
Mar 10, 2026
Merged

Scottcjn merged 1 commit into
Scottcjn:mainfrom
waterwater123:feature/miner-dashboard-501

Conversation

@waterwater123

Copy link
Copy Markdown

Summary

This PR implements a self-contained miner dashboard that allows RustChain participants to track their personal stats, reward history, and network participation.

🎯 What This Dashboard Does

  • Balance Tracking: Display current RTC balance for any miner wallet
  • Miner Information: Show hardware details, antiquity multiplier, and attestation history
  • Network Status: Real-time epoch, slot, and network statistics
  • Reward History: Transaction history with status indicators
  • Activity Monitoring: Recent attestation activity across the network
  • Shareable URLs: Pass miner ID via URL parameter for easy sharing
  • Mobile Responsive: Works seamlessly on desktop and mobile devices

🚀 Usage

For Miners

  1. Open the dashboard in a browser
  2. Enter your Miner ID (e.g., scott)
  3. View your balance, history, and stats

Shareable Link

Share your dashboard with others:

dashboards/miner-dashboard/index.html?miner_id=your_wallet

📊 API Endpoints Consumed

All endpoints are public and read-only:

Endpoint Purpose
GET /wallet/balance?miner_id={id} Fetch miner's RTC balance
GET /wallet/history?miner_id={id}&limit=20 Fetch transaction history
GET /api/miners List active miners (for miner info)
GET /epoch Current epoch and network stats

✅ Acceptance Criteria

  • Miner ID can be entered or shared via URL parameter
  • Current balance is displayed
  • Recent reward/epoch history is displayed
  • Recent attestation/participation activity is displayed
  • Page works against the live RustChain API
  • PR includes setup/usage notes
  • Mobile-responsive design implemented

🎨 Design Choices

  • No Framework Dependencies: Pure HTML/CSS/JS for maximum compatibility
  • Dark Theme: Matches RustChain's visual style
  • Client-Side Only: No server-side processing required
  • Fast Loading: Parallel API calls for optimal performance
  • Error Handling: User-friendly error messages

📱 Bonus Features

  • ✅ Shareable URL parameters
  • ✅ Mobile responsiveness
  • ✅ Auto-load from URL parameter
  • ✅ Real-time error handling
  • ✅ Status badges for transactions
  • ✅ Clean, minimal UI

🧪 Testing

Tested with live RustChain API:

# API endpoints verified working
curl -sk "https://rustchain.org/epoch"
curl -sk "https://rustchain.org/wallet/balance?miner_id=scott"
curl -sk "https://rustchain.org/api/miners"

📦 Files Added

dashboards/miner-dashboard/
├── index.html          # Self-contained dashboard (686 lines)
└── README.md           # Usage documentation

🎯 Next Steps (Optional)

Future enhancements could include:

  • Chart.js integration for balance history visualization
  • Auto-refresh functionality
  • Multi-miner comparison view
  • Export data as CSV/JSON

RTC Wallet: xiaoma-miner
Discord: xiaoma
Related Issue: #501

- Self-contained HTML/CSS/JS dashboard (no framework dependencies)
- Real-time balance tracking via RustChain API
- Transaction history display
- Network status overview
- Mobile-responsive design
- Shareable URLs with miner_id parameter
- Dark theme matching RustChain visual style

Features:
- Balance display (RTC tokens)
- Miner information (hardware, multiplier, attestations)
- Network stats (epoch, slot, enrolled miners)
- Reward history table
- Attestation activity monitoring

API Endpoints Used:
- GET /wallet/balance
- GET /wallet/history
- GET /api/miners
- GET /epoch

Bonus features implemented:
- Shareable URL parameters
- Mobile responsiveness
- Auto-load from URL
- Error handling with user-friendly messages
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 10, 2026
@github-actions github-actions Bot added the size/XL PR: 500+ lines label Mar 10, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Your PR has a BCOS-L1 or BCOS-L2 label
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@MontaEllis8 MontaEllis8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Code Review 通过

代码审查通过,建议合并。

@MontaEllis8 MontaEllis8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature addition! The miner dashboard provides useful functionality for tracking miner stats. Consider adding:

  • API error handling for edge cases
  • Loading states for better UX
  • Rate limiting consideration for frequent API calls

Reviewer: Jeff-Dean AI
Wallet: RTC55b7ce16ad72ec7d1f5878d82a3a90c3d3e29876

@waterwater123

Copy link
Copy Markdown
Author

@Scottcjn Hi! 👋

Just wanted to bring this PR to your attention. I've completed the Miner Dashboard implementation for bounty #501.

PR #796 implements all requirements:

  • ✅ Self-contained HTML dashboard (no frameworks)
  • ✅ Real-time balance tracking
  • ✅ Transaction/reward history
  • ✅ Network status overview
  • ✅ Miner information display
  • ✅ Shareable URLs (?miner_id=wallet)
  • ✅ Mobile-responsive design
  • ✅ Dark theme matching RustChain style

Live Demo: Can be tested by opening in a browser

All API endpoints tested and working against the live RustChain API. Ready for review! 🚀

RTC Wallet:

Thanks for maintaining this project! 💪

@Scottcjn
Scottcjn merged commit 1e1eb17 into Scottcjn:main Mar 10, 2026
3 checks passed
@Scottcjn

Copy link
Copy Markdown
Owner

@waterwater123 — 75 RTC payment queued (pending #799) to wallet xiaoma-miner for the miner dashboard. Solid delivery, sorry for the delay!

createkr pushed a commit to createkr/Rustchain that referenced this pull request Mar 22, 2026
…board-501

Add Miner Dashboard - Personal stats and reward tracking (Scottcjn#501)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/XL PR: 500+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants