pages

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

templ: version: v0.3.898

Index

Constants

View Source
const UnearnedRewardsThreshold = int64(10000)

Variables

This section is empty.

Functions

func CamelCaseKeys

func CamelCaseKeys(result []map[string]interface{}) []map[string]interface{}

Types

type AdjudicatePageView

type AdjudicatePageView struct {
	ServiceProvider       *ServiceProvider
	StartTime             time.Time
	EndTime               time.Time
	MetSlas               int
	PartialSlas           int
	DeadSlas              int
	TotalSlas             int
	TotalStaked           int64
	TotalChallenges       int64
	FailedChallenges      int64
	Slash                 SlashRecommendation
	ActiveSlashProposalId int64
	DashboardURL          string
	ReportingEndpoint     *Endpoint
}

type BlockView

type BlockView struct {
	Height           int64
	Hash             string
	Proposer         string
	ProposerEndpoint string
	Timestamp        time.Time
	Txs              [][]byte
}

type ConsensusClassification added in v1.8.0

type ConsensusClassification string

ConsensusClassification is a coarse, operator-facing label for the state of the CometBFT consensus engine. It is derived entirely from the sanitized `/consensus_state` round data (no peer identities / topology), so it is safe to surface on the public console.

const (
	// ConsensusHealthy: blocks are committing and rounds are low.
	ConsensusHealthy ConsensusClassification = "healthy"
	// ConsensusCatchingUp: node is state/block syncing; halt detection is suppressed.
	ConsensusCatchingUp ConsensusClassification = "catching_up"
	// ConsensusDegraded: rounds are elevated but the chain still looks like it's
	// making (slow) progress. An early warning, not a halt.
	ConsensusDegraded ConsensusClassification = "degraded"
	// ConsensusHaltLiveness: stuck, and votes are overwhelmingly nil — nobody can
	// build/accept a proposal. This is the "every proposal rejected" liveness
	// failure (e.g. oversized blocks, ProcessProposal rejecting every batch).
	ConsensusHaltLiveness ConsensusClassification = "halted_liveness"
	// ConsensusHaltSplit: stuck, and within a round votes are split across two or
	// more competing block hashes — a sign of non-determinism / app-hash divergence.
	ConsensusHaltSplit ConsensusClassification = "halted_split"
	// ConsensusHaltUnknown: stuck, but the vote pattern doesn't cleanly match
	// either bucket above.
	ConsensusHaltUnknown ConsensusClassification = "halted_unknown"
	// ConsensusUnknown: consensus state couldn't be read/parsed.
	ConsensusUnknown ConsensusClassification = "unknown"
)

func (ConsensusClassification) IsHalt added in v1.8.0

func (c ConsensusClassification) IsHalt() bool

IsHalt reports whether the classification represents a halted chain.

type ConsensusHealth added in v1.8.0

type ConsensusHealth struct {
	Classification ConsensusClassification
	Halted         bool

	Height int64
	Round  int32
	Step   string

	SecondsSinceLastBlock float64
	LastBlockTime         time.Time
	CatchingUp            bool

	// Participation, taken from the height's most-populated round.
	TotalValidators    int
	VotingValidators   int
	PrevotePowerFrac   float64 // 0..1 of total voting power that prevoted
	PrecommitPowerFrac float64 // 0..1 of total voting power that precommitted

	// Vote breakdown aggregated across every round of the current height.
	NilPrevotes         int // present votes cast for nil
	BlockPrevotes       int // present votes cast for a real block
	DistinctBlockHashes int // distinct non-nil block hashes seen across all rounds
	MaxHashesInRound    int // most distinct non-nil hashes seen within a single round

	Summary string
}

ConsensusHealth is the sanitized view model rendered by the console. It deliberately omits peer IDs and per-validator identities that a full dump_consensus_state would expose.

func AnalyzeConsensusState added in v1.8.0

func AnalyzeConsensusState(roundStateJSON []byte, latestBlockTime time.Time, catchingUp bool, now time.Time, th HaltThresholds) (*ConsensusHealth, error)

AnalyzeConsensusState turns a raw CometBFT round_state payload (the `round_state` field of a /consensus_state response) plus basic status info into a sanitized ConsensusHealth summary.

latestBlockTime / catchingUp come from the node's /status. now is injected so the function is deterministic and testable.

func UnknownConsensusHealth added in v1.8.0

func UnknownConsensusHealth() *ConsensusHealth

UnknownConsensusHealth is returned when the RPC/consensus state can't be read.

func (*ConsensusHealth) ShowPanel added in v1.8.0

func (h *ConsensusHealth) ShowPanel() bool

ShowPanel reports whether the consensus panel is worth rendering. It's only shown when the chain needs attention — halted, or degraded (elevated rounds, the early-warning before a halt). Healthy / catching-up / unknown add no signal beyond the overview's existing status row, so the panel is hidden.

type ConsensusNode added in v1.2.6

type ConsensusNode struct {
	CometAddress string
	Endpoint     string
	EthAddress   string
	NodeType     string
	VotingPower  int64
	Version      string
}

type CopyButtonProps

type CopyButtonProps struct {
	Size     int
	CustomId string
}

type Endpoint

type Endpoint struct {
	EthAddress      string
	CometAddress    string
	Endpoint        string
	Owner           string
	IsEthRegistered bool
	RegisteredAt    time.Time
	ActiveReport    *SlaReport
	SlaReports      []*SlaReport
}

type EthEndpoint added in v1.2.6

type EthEndpoint struct {
	Endpoint       string
	ServiceType    string
	Owner          string
	DelegateWallet string
	BlockNumber    int64
}

type HaltThresholds added in v1.8.0

type HaltThresholds struct {
	// HaltAfter: if no block has committed for at least this long, treat as halted.
	HaltAfter time.Duration
	// HighRound: if the current consensus round is >= this, treat as halted
	// regardless of elapsed time (rounds are normally 0).
	HighRound int32
	// WarnRound: round >= this (but below HighRound / time threshold) is "degraded".
	WarnRound int32
}

HaltThresholds tunes when the analyzer decides the chain is halted vs merely degraded. Zero values disable the corresponding check.

func DefaultHaltThresholds added in v1.8.0

func DefaultHaltThresholds() HaltThresholds

DefaultHaltThresholds are conservative defaults chosen to avoid false positives during normal (single-digit-second) block cadence.

type NodePageView

type NodePageView struct {
	Endpoint     string
	EthAddress   string
	CometAddress string
}

type NodesView

type NodesView struct {
	ConsensusNodes      []ConsensusNode
	ConsensusNodesCount int
	Nodes               []db.CoreValidator
	ValidatorNodesCount int
	EthEndpoints        []EthEndpoint
	EthEndpointsCount   int
	// Validators registered in core_validators but not currently in the
	// CometBFT consensus set.
	MissingFromConsensus []db.CoreValidator
	// Eth registry endpoints with no matching registered validator node.
	MissingFromValidators []EthEndpoint
}

type Pages

type Pages struct {
	// contains filtered or unexported fields
}

func NewPages

func NewPages(config *config.Config, baseUrl string) *Pages

func (*Pages) AdjudicatePageHTML

func (c *Pages) AdjudicatePageHTML(props *AdjudicatePageView) templ.Component

func (*Pages) BlockPageHTML

func (p *Pages) BlockPageHTML(view *BlockView) templ.Component

func (*Pages) ConsensusHaltBanner added in v1.8.0

func (p *Pages) ConsensusHaltBanner(h *ConsensusHealth) templ.Component

ConsensusHaltBanner renders a site-wide alert only when the chain is halted. It is intentionally empty otherwise so it can be polled on every page.

func (*Pages) ConsensusPanelFragment added in v1.8.0

func (p *Pages) ConsensusPanelFragment(h *ConsensusHealth) templ.Component

ConsensusPanelFragment renders the consensus health detail card. ConsensusPanelFragment renders the consensus health detail card, but only for states worth an operator's attention (halted or degraded); healthy, syncing and unknown states render nothing.

func (*Pages) ContentPageHTML

func (p *Pages) ContentPageHTML() templ.Component

func (*Pages) ErrorPageHTML

func (p *Pages) ErrorPageHTML(errorID string) templ.Component

func (*Pages) GenesisHTML

func (p *Pages) GenesisHTML(genesis map[string]interface{}) templ.Component

func (*Pages) NodePageHTML

func (p *Pages) NodePageHTML(data *NodePageView) templ.Component

func (*Pages) NodesPageHTML

func (p *Pages) NodesPageHTML(data *NodesView) templ.Component

func (*Pages) OverviewCriticalFragment

func (p *Pages) OverviewCriticalFragment(status *v1.GetStatusResponse) templ.Component

func (*Pages) OverviewNetworkFragment

func (p *Pages) OverviewNetworkFragment(status *v1.GetStatusResponse) templ.Component

func (*Pages) OverviewPage

func (p *Pages) OverviewPage(status *v1.GetStatusResponse, health *ConsensusHealth) templ.Component

func (*Pages) OverviewProcessesFragment

func (p *Pages) OverviewProcessesFragment(status *v1.GetStatusResponse) templ.Component

func (*Pages) OverviewResourcesFragment

func (p *Pages) OverviewResourcesFragment(status *v1.GetStatusResponse) templ.Component

func (*Pages) OverviewStorageFragment added in v1.1.7

func (p *Pages) OverviewStorageFragment(status *v1.GetStatusResponse) templ.Component

func (*Pages) PoSPageHTML

func (c *Pages) PoSPageHTML(props *PoSPageView) templ.Component

func (*Pages) StoragePage added in v1.2.14

func (*Pages) TxPageHTML

func (p *Pages) TxPageHTML(view *TxView) templ.Component

func (*Pages) UploadPage

func (p *Pages) UploadPage() templ.Component

func (*Pages) UptimePageHTML

func (c *Pages) UptimePageHTML(props *UptimePageView) templ.Component

type PoSPageView

type PoSPageView struct {
	Address       string
	BlockStart    int64
	BlockEnd      int64
	StorageProofs []*StorageProof
}

type ServiceProvider

type ServiceProvider struct {
	Address             string
	Endpoints           []*Endpoint
	StorageProofRollups map[string]*StorageProofRollup
}

type SlaReport

type SlaReport struct {
	SlaRollupId         int32
	Status              SlaStatus
	TxHash              string
	BlockStart          int64
	BlockEnd            int64
	BlocksProposed      int32
	Quota               int32
	ValidatorCount      int64
	PoSChallengesFailed int32
	PoSChallengesTotal  int32
	Time                time.Time
}

type SlaStatus

type SlaStatus = int
const (
	SlaDead SlaStatus = iota
	SlaPartial
	SlaMet
	SlaExempt
)

type SlashRecommendation

type SlashRecommendation struct {
	Amount    int64
	Signature string
	Attestors map[string]string
}

type StorageProof

type StorageProof struct {
	BlockHeight int64
	Endpoint    string
	Address     string
	CID         string
	Status      string
}

type StorageProofRollup

type StorageProofRollup struct {
	ChallengesReceived int64
	ChallengesFailed   int64
}

type TxView

type TxView struct {
	Hash      string
	Block     string
	Timestamp time.Time
	Tx        []byte
}

type UptimePageView

type UptimePageView struct {
	ActiveEndpoint *Endpoint
	Endpoints      []*Endpoint
	AvgBlockTimeMs int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL