Documentation
¶
Index ¶
- Constants
- func DoubleProgressBar(prevotePct, precommitPct float64, width int) string
- func FormatPercent(percent float64) string
- func FormatVoteGrid(pattern string, width int) string
- func ProgressBar(percent float64, width int) string
- func ProgressBarWithLabel(percent float64, width int, label string) string
- func RenderView(ctx ViewContext) string
- type BackMsg
- type BlockRecord
- type BlockValidatorVote
- type HubTab
- type Model
- type ModelConfig
- type OracleEvent
- type OraclePriceEntry
- type OracleState
- type ProviderDetail
- type ProviderDetailState
- type ProviderList
- type ProviderLoader
- type ProviderViewState
- type StatusInfo
- type Tab
- type ViewContext
Constants ¶
const ( RenderInterval = 100 * time.Millisecond // throttle re-renders ChainSyncInterval = 10 * time.Minute ProviderCheckInterval = 200 * time.Millisecond CacheSaveInterval = 30 * time.Second GovernanceSyncInterval = 5 * time.Minute OracleSyncInterval = 30 * time.Second MaxConcurrentChecks = 10 MaxBlockHistory = 50 )
Variables ¶
This section is empty.
Functions ¶
func DoubleProgressBar ¶
DoubleProgressBar renders two stacked progress bars: top for prevotes (green), bottom for precommits (cyan). This replaces the previous half-block (▀) design with standard bubbles/progress components.
func FormatPercent ¶
FormatPercent formats a percentage with color based on threshold. Delegates to the shared tui/components implementation.
func FormatVoteGrid ¶
FormatVoteGrid formats the bit array pattern into a colored grid
func ProgressBar ¶
ProgressBar renders a progress bar with the given percentage (0-1). Delegates to the shared tui/components implementation.
func ProgressBarWithLabel ¶
ProgressBarWithLabel renders a progress bar with a text label centered inside it. Delegates to the shared tui/components implementation.
Types ¶
type BackMsg ¶
type BackMsg struct{}
BackMsg is sent by an embedded Model (Embedded=true in ModelConfig) when the user requests to leave the monitor view (q or Esc with nothing expanded). The parent TUI handles this by navigating back.
type BlockRecord ¶
type BlockRecord struct {
Height int64
PrevotePercent float64
PrecommitPercent float64
Round int
Step int
Elapsed time.Duration // total time the block took
Timestamp time.Time // when the record was captured
Validators []BlockValidatorVote // vote snapshot per validator
}
BlockRecord stores the final vote state of a completed block.
type BlockValidatorVote ¶
type BlockValidatorVote struct {
Index int
Address string
PubKey string // base64 consensus pubkey for moniker lookup
VotingPower int64
Prevoted bool
Precommited bool
}
BlockValidatorVote stores a single validator's vote state for a block.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the application state
func (Model) StatusInfo ¶
func (m Model) StatusInfo() StatusInfo
StatusInfo returns the current status bar information. This allows the parent TUI to render a unified status bar when the monitor model is embedded.
type ModelConfig ¶
type ModelConfig struct {
Client *rpc.Client
RPCClient *rpc.RPCProviderClient
Cache cache.ProviderStore
MonikerCache *cache.MonikerCache
InsecureSkipVerify bool
Embedded bool // when true, q sends BackMsg instead of tea.Quit
InitialDashboard string // "network" (default), "provider", "oracle", "bme"
Bus pubsub.Bus // shared event bus; may be nil
}
ModelConfig holds configuration options for creating a new Model.
type OracleEvent ¶
type OracleEvent struct {
Type string // "price", "stale_warning", "staled", "recovered", "aggregated"
Denom string
Detail string
Timestamp time.Time
}
OracleEvent is a display-friendly record for the oracle event log.
type OraclePriceEntry ¶
type OraclePriceEntry struct {
Denom string
Price string
Source string // oracle provider address
Timestamp time.Time
}
OraclePriceEntry is a single price feed event.
type OracleState ¶
type OracleState struct {
// Prices stores the most recent EventPriceData per source+denom.
Prices []OraclePriceEntry
// Aggregated stores the most recent aggregated prices per denom.
Aggregated map[string]*oracletypes.EventAggregatedPrice
// Events is a capped log of recent oracle events (newest first).
Events []OracleEvent
ScrollPos int
// Version is the detected oracle API version ("v1", "v2", or "none").
// Empty string means not yet determined.
Version string
// BME state — populated from REST queries.
BMEStatus *bmetypes.QueryStatusResponse
BMELedger []bmetypes.QueryLedgerRecordEntry
}
OracleState holds live oracle and BME data for the Oracle/BME dashboard.
type ProviderDetail ¶
type ProviderDetail struct {
Showing bool
Provider *rpc.Provider
Nodes []rpc.ProviderNodeWithGPU
Loading bool
Error error
}
ProviderDetail holds the state for the provider detail view.
type ProviderDetailState ¶
type ProviderDetailState struct {
Showing bool
Provider *rpc.Provider
Nodes []rpc.ProviderNodeWithGPU
Loading bool
Error error
}
ProviderDetailState holds the state for provider detail view
type ProviderList ¶
type ProviderList struct {
Items []rpc.Provider
Versions []string // unique versions, sorted latest first
Version string // currently selected version filter
VersionIdx int // index in Versions
}
ProviderList holds the state for the provider list view.
type ProviderLoader ¶
type ProviderLoader struct {
FirstRun bool
Loading bool
Total int
Checked int
ActiveLease map[string]bool // providers with active leases (priority)
Queue []string // providers to check
InFlight map[string]bool // providers currently being checked
LastSync time.Time
LastSave time.Time
LastSaveError error
}
ProviderLoader holds the state for background provider loading/checking.
type ProviderViewState ¶
type ProviderViewState struct {
Providers []rpc.Provider
Versions []string
Selected string
Loading bool
Loaded int
Total int
Detail ProviderDetailState
}
ProviderViewState holds the state for the providers tab
type StatusInfo ¶
type StatusInfo struct {
Endpoint string
WSConnected bool
HubTab HubTab
ActiveTab Tab
DetailShowing bool
}
StatusInfo holds status bar information exposed by the monitor model so the parent TUI can render a unified status bar.
func (StatusInfo) TabHelpText ¶
func (si StatusInfo) TabHelpText() string
TabHelpText returns the keybinding help text for the active hub/tab.
type ViewContext ¶
type ViewContext struct {
State *consensus.State
Endpoint string
Width int
Height int
HubTab HubTab
ActiveTab Tab
Embedded bool // when true, skip the bottom help/status lines
Monikers map[string]string
Providers ProviderViewState
GovernanceParams *governance.AllParams
BlockHistory []BlockRecord
ExpandedBlock int // -1=none, 0=current, 1+=history index
ExpandedScroll int
ExpandedValidators []BlockValidatorVote // frozen snapshot
ExpandedValidator int // expanded validator (-1=none)
ValSignHistory map[int][]bool // per-validator signing history
ProposerHistory []int // proposer index per historical block (newest first)
CurrentProposer int // current block's proposer index (-1=unknown)
WSConnected bool
Oracle OracleState
// Bubbles component models
ProviderTable table.Model
NodeTable table.Model
ValidatorTable table.Model
BlockTable table.Model
GovModuleIdx int // selected module index
GovModuleScroll int // first visible module index
GovModuleHeight int // visible rows for module list
GovParamView viewport.Model
}
ViewContext holds all data needed to render the view