Terminal UI
Guide to the Railguard Terminal User Interface for monitoring transactions.
Railguard includes a Terminal User Interface (TUI) built with ratatui that displays real-time transaction monitoring.
Layout
Panels
Status Bar
Shows the current proxy status and listen address:
- Running — Proxy is active and accepting requests
- Starting — Proxy is initializing
- Shutting down — Graceful shutdown in progress
Transactions List
A scrolling list of all transaction attempts:
| Indicator | Meaning |
|---|---|
[PASS] | Transaction allowed and forwarded (green) |
[BLOCK] | Transaction blocked by policy (red) |
Each entry shows:
- JSON-RPC method (
eth_sendTransactionoreth_sendRawTransaction) - Destination address (truncated)
- Transaction hash if forwarded (truncated)
- Block reason if blocked
Details Panel
When a transaction is selected, shows full details:
| Field | Description |
|---|---|
| ID | Unique receipt UUID |
| Time | Timestamp of the attempt |
| Method | JSON-RPC method name |
| From | Sender address |
| To | Destination address |
| Value | ETH value in wei |
| Selector | 4-byte function selector (if calldata present) |
| Verdict | Allowed or Blocked { reason } |
| Latency | Policy inspection time in microseconds |
| Tx Hash | Transaction hash (if forwarded successfully) |
Logs Panel
System logs showing:
- Proxy lifecycle events
- Read-only request forwarding
- Upstream connection status
- Errors and warnings
Keyboard Controls
| Key | Action |
|---|---|
↑ / k | Move selection up |
↓ / j | Move selection down |
Page Up | Scroll up one page |
Page Down | Scroll down one page |
Home | Jump to first entry |
End | Jump to last entry |
q / Ctrl+C | Quit |
l | Toggle logs panel |
? | Show help |
Color Coding
The TUI uses colors to quickly identify transaction status:
| Color | Meaning |
|---|---|
| Green | Transaction allowed and forwarded |
| Red | Transaction blocked by policy |
| Yellow | Warning (e.g., decode error in monitor mode) |
| Blue | Informational |
| Gray | Read-only requests (not shown in main list) |
Non-Interactive Mode
When running in a non-TTY environment (CI/CD, piped output), Railguard automatically disables the TUI and outputs structured logs instead:
Output format:
Receipt Structure
Each transaction generates a Receipt that powers the TUI display:
Event Channel
The TUI receives events from the proxy via an async channel:
This architecture keeps the proxy responsive—TUI rendering never blocks request handling.
Customization
Currently, the TUI layout is fixed. Future versions may support:
- Configurable panel sizes
- Theme customization
- Export to JSON/CSV
- Filtering by verdict or address
Troubleshooting
TUI Not Rendering
If the TUI doesn't appear:
- Check terminal size — Minimum 80x24 recommended
- Check TTY — Must be running in a terminal, not piped
- Check TERM variable — Should be set (e.g.,
xterm-256color)
Flickering
If the display flickers:
- Use a terminal with better rendering (iTerm2, Alacritty, kitty)
- Increase terminal buffer size
- Check for high CPU usage
Missing Characters
If icons don't render:
- Install a Nerd Font (Fira Code Nerd Font recommended)
- Configure your terminal to use the font
- Check Unicode support
Next Steps
- CLI Reference — Command-line options
- Configuration — Config file reference
- Policy Engine — How inspection works