Skip to content

Conversation

@ncitron
Copy link
Collaborator

@ncitron ncitron commented Jun 13, 2025

Summary

This PR adds a comprehensive Terminal User Interface (TUI) to Helios that can be launched with the --tui flag. The TUI provides real-time monitoring of blockchain sync status and block production.

Features

  • Real-time block monitoring: Displays latest, safe, and finalized block numbers (network-aware)
  • Sync status indicator: Shows sync progress with percentage for Ethereum, special handling for OpStack/Linea
  • Block details panel: Shows hash, timestamp, transaction count, gas usage, and base fee for the latest block
  • Recent blocks history: Unlimited scrollable list of blocks seen during the session
  • Network-aware display: Adapts UI based on chain type (Ethereum vs OpStack/Linea)
  • Auto-refresh: Updates every second with dynamic block age calculation
  • Local timezone: All timestamps shown in user's local time

Implementation Details

  • Built with ratatui for cross-platform terminal UI
  • Integrates cleanly with existing Helios architecture
  • Network-specific features handled via NetworkSpec trait
  • Proper handling of OpStack/Linea sync detection (u64::MAX case)

Usage

helios --tui

Press q to quit the TUI.

Screenshots

The TUI displays:

  • Header with network name, sync status, and uptime
  • Block numbers panel (Latest, Safe, Finalized)
  • Latest block details with full hash and metrics
  • Scrollable recent blocks history

Testing

Tested with:

  • Ethereum mainnet/Sepolia (shows finalized/safe blocks)
  • OP Stack networks (no finalized/safe blocks)
  • Linea networks (special sync handling)

ncitron added 4 commits June 13, 2025 02:24
Add a comprehensive TUI for Helios that provides real-time monitoring of:
- Current block numbers (latest, safe, finalized where applicable)
- Sync status with progress indication
- Block production rate and age
- Recent block history with timestamps
- Detailed block information panel

The TUI is network-aware and adapts its display based on the chain type:
- Ethereum shows finalized and safe blocks
- OpStack/Linea networks only show latest blocks
- Special handling for OpStack/Linea sync detection

Implementation uses ratatui for terminal rendering with:
- Auto-refreshing display (1 second intervals)
- Local timezone for timestamps
- Dynamic block age calculation
- Unlimited block history during session
- Clean, colorful interface with visual indicators
- Remove unused parent_hash field from BlockInfo
- Remove unused chain_id field from App struct
- Replace single-pattern match with if let expression
- Simplify sync status to just Synced/Syncing states
- Remove network-specific hardcoding for block types
- Dynamically check block availability for all networks
- Extract helper functions for cleaner draw_latest_block_details
- Unify block fetching with update_block_type helper method
- Add Safe block type support (display only, not in history)
- Add ratatui to codespell ignore words to fix CI check
- Run cargo fmt on TUI code
@ncitron ncitron merged commit 500d3d4 into master Jun 16, 2025
6 checks passed
@ncitron ncitron deleted the feat/tui-interface branch June 16, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants