gnockpit is a real-time monitoring dashboard for gno.land validator nodes. It's a single Go binary (gnockpit [flags], no subcommands) that connects to one or more gnoland RPC endpoints (-rpc, repeatable), consolidates their views, and serves a live web dashboard, with web-push/PWA alerts and external (Shoutrrr) notifications.
main.go — CLI entry point (single command: starts the web dashboard)
node/ — RPC client + types (pure data layer, no UI)
client.go — HTTP client for Tendermint RPC (/status, /net_info, /validators, etc.)
sources.go — Sources: an ordered set of RPC endpoints polled together; best-source pick for global data + peer union/dedup (MergePeers)
ip.go — public-IP validation (IsPublicIP): only public IPs are ever geolocated or displayed
types.go — snapshot and dashboard types (Status, Peer, Validator, Snapshot, SigningStats, etc.)
validators.go — NameRegistry: maps validator addresses ↔ monikers, persists to JSON
geoip.go — DB-IP City Lite: IP → coordinates + country (auto-downloaded, monthly)
asn.go — DB-IP ASN Lite: IP → ASN + cloud provider (auto-downloaded, monthly)
abci.go — ABCI queries: realm renders (valoper names, profiles), valoper state via vm/qeval, the halt params
rpcerror.go — HTTPStatusError, RPCError, IsRefusal
signing.go — per-validator signing over the live window (computeSigning): missed, its nil / other-block split, vote delay
median.go — tm2's voting-power-weighted median time (MedianTime), shared with blocks/record.go
batch.go — JSON-RPC batches (one POST, several calls); HeightError
chain.go — Commit/Precommit, SetMember, BlockEvent and their reads: commits (one, or a batch), validator sets with priorities, block events
blocks/ — block history since genesis: per-height facts in SQLite, filled from the primary source (shares the push DB handle)
store.go — schema, block rows (absences, round proposers, flags), the counters Write keeps beside them (days, gaps, absence runs, vote delays), meta (chain id, floor, one-time fills); each address once (blocks_validators), the rest by id (blocks_events keeps text addresses), no index beside the keys
days.go — blocks_days: per UTC day and validator, absences by kind, proposals expected / missed
proposals.go — a block's proposals expected and missed (proposalCounts); round-0 blocks by aggregate in the one-time fill
gaps.go — blocks_gaps: restarts (RestartGap, 2 min, between blocks b and b+1)
runs.go — blocks_absence_runs: each validator's runs of consecutive absences (absent or other block)
history.go — ValidatorHistory: a validator's days, outages, recoveries and scoring-window summary; WindowHistory: the same as a scoring window ends (absences to its last height, block times to the next); the scoring constants
scoring.go — ScoringWindow (the 30 complete UTC days before today, its heights, the 180-day span's start), ProposalFlags (the window's heights whose proposals cannot be checked)
keys.go — an operator's signing keys over time (OperatorKeys), a key's operator (OperatorOf), Known
valsets.go — validator sets by hash; address → id
windows.go — missed-block windows and proposals expected / missed: first block by bisecting heights, the first (partial) day's absences and late blocks + the per-day counters, one read transaction
delays.go — daily vote-delay histograms (bucket edges)
changes.go — validator set changes: their heights (blocks_valset_changes, kept by Write; filled by one scan while `valset_changes_filled` is unset), each read with its diff against the set below (added, removed, re-weighted, rotations from events)
events.go — set-change events: stored, read from /block_results at H−2, event gaps
record.go — a commit + its validator set → a Record: absence kinds, vote delays from tm2's weighted median time
proposer.go — port of tm2's proposer-priority increment: the expected proposer of each round
tracker.go — fill loop (Data Flow #7)
reads.go — the fill's rate-limited reads, record building, round proposers + flags
progress.go — Progress (read from the store when the tracker is built, then at each publish), fill rate
eta/ — block ETAs: sampled block times + estimator + halt tracking (shares the push DB handle)
store.go — eta_block_times (every 100th height), chain id, backfill floor, first sighting of each halt
model.go — pure estimator: pace of the last 3000 blocks; 80/95% ranges from the predictor's past errors (30-day lookback)
tracker.go — background loop on the primary source: backfill newest-first (~4 req/s, honours 429 Retry-After), halt params (View.Halt only while above the head; View.HaltParam kept once reached, for the chain-stuck notice)
presence/ — how often gnockpit's polls listed each peer (shares the push DB handle)
store.go — `Record`, `Figures`, the tables and their retention (35 days per UTC day; each first listing and the chain's first poll kept for good)
ranking/ — the validator ranking, published once a UTC day (ranking_days shares the push DB handle): the scoring formula as pure code over each operator's blocks.History, and that input read from the block store
rank.go — Rank: scores (exact), status, the order and shared ranks; FormulaVersion and the formula's constants (no database access)
gather.go — Gather: the operators in the set at the window's last height, their keys linked by profile, then every stored event, and their histories as the window ends (WindowHistory); Readiness: ready, filling or unavailable
publisher.go — Publisher: a pass every 30 s serving Readiness and the chain's latest stored day; once ready, publishes today's (Gather → Rank → DayStore.Put), then OnPublish; today's served day with the same formula and exclusion list is not recomputed
store.go — ranking_days by (chain, day), the formula and exclusion list beside each; Latest, Previous
digest.go — DigestOf: the daily alert's title, rows and notes, its day, window and formula, and the counts excluded and not ranked yet; Body writes the rows and notes as text
location/ — an operator's declared validator location: the signed record, its verification, its store (location_declarations shares the push DB handle)
record.go — Record, ParseMemo (the memo's v1 record, read strictly), ValidProvider, ValidCountry
countries.go — CountryCodes: the 249 ISO 3166-1 alpha-2 codes and XK
provider.go — ProviderKey, ListedProvider (one spelling per provider), OnPremise, MaxProvider
document.go — the /bank.MsgSend mirror, SignBytes (Legacy and Current renderings), Verify, Declaration (Signed: the canonical amino form); only a gnokey secp256k1 key verifies (crypto/mock's PubKeyMock is registered in every binary), so a multisig operator cannot declare
store.go — Store: location_declarations by (chain, operator), every row in memory; a removal replaces the row as a tombstone; Put holds a writer mutex through its ErrNotNewer check, its wait for a connection (≤ 10 s), its write (detached from the caller, never cut short: modernc reports an interrupted write failed even once it committed) and the memory update, so Get and All never wait on the database
locationtest/ — test support: Memo, Document, Sign
testdata/ — documents signed by real gnokeys (v1.1.0, v1.7.1)
web/ — Web dashboard + HTTP API
server.go — HTTP/WebSocket server, background data fetcher, system info collector
status.go — /api/status: health + curated network state / recent blocks / peer + validator columns
stats.go — /api/stats: missed-block windows, provider/country aggregates, set health, Nakamoto
presence.go — refreshPresence: records the poll and fills each peer's Presence, at publish
eta.go — /api/eta: ETA of a height, height at a time, or the scheduled halt (model from eta.Tracker)
history.go — /api/history: the block history's reach, the blocks of a height range (≤ 1,000), daily vote delays (≤ 31 days), set changes (≤ 100 a page)
validator.go — /api/validator: one validator's page data (see Validator history)
validator_timeline.go — /api/validator's timeline: set changes, outages and recoveries as entries, the status's since
ranking.go — /api/ranking: the ranking's state and latest published day, from ranking.Publisher
location.go — POST /api/location: verify, check (declarableKey: the profile's key in the current set, not located by IP; locatedKeys; declarability: the set, the profiles and the located keys, read once per answer), store, its body read within documentReadTimeout (10 s; the documentTimeout seam); listedProviders, locationChain; what shows: shownDeclarations (by signing key), operatorDeclaration (/api/validator's), each provider matched again against listedProviders
api.go — serveJSON, errorBody: the JSON API's response writing
links.go — /api/links: the header links (--link) and the status links (--status-link), each with its BetterStack page's state, polled every 45 s
reminder.go — /api/push/reminder; schedule(): the head, the scheduled halt and time-left estimates the lead-time alerts check
push/ — browser push and Shoutrrr: alert detection, alert bodies as spans, each key fact bold, plain for text targets and browser push (types.go: Body, Body.String; alerts.go: the body builders, a validator's name cut to 64 runes (cutName)), devices (one per push endpoint), the notification config file (notifyconfig.go: parse, a target's `show_chain`; notifyroute.go: per-target senders, chainOf: the chain name a target's messages carry, reload on change), the text every non-Discord target gets (notify.go: FormatAlert; heading, the title line a Discord embed shares with FormatAlert; a zero-width space after each `@` and `<`, the link aside; pageLink, a path at `--public-url`), a Discord target's payload, one embed per alert, no footer or timestamp, `allowed_mentions` allowing no kind of mention on every payload, the ranking a gold embed, its ANSI table in code blocks over as many embeds and messages as it takes and its fields under the last, posted through shoutrrr's json mode (discord.go: discordAlert: the `Open in Gnockpit ↗` line (openLine) with `--public-url`; maskedLink: every link's parentheses percent-encoded; packEmbeds: the fields on the last embed, counted in every payload, a blank line opening no embed; discord_ranking.go: discordRanking; rankingTable: rank, name and change coloured, a name's control and format characters as U+FFFD but the zero-width joiner, backticks broken; rankingFields: formula, window, counts ranked and not ranked, the open line; discord_markdown.go: markdownLines: a body's key facts between `**`, adjacent bold spans as one, a bold span's edge white space outside them, each line of a multi-line one bold apart; the Markdown of a body escaped, `<` and `@` too, the `:` of each `://` so that no scheme URL auto-links (a bare domain stays as it is), and a line's block marker, inside a bold span opening the line too (blockMarker: `#`, `>`, `-` or `+` after any white space, a number's dot)), chain alerts and their sent state (schedule.go), ETA reminders (reminders.go), the daily ranking's sender (notifyroute.go: NotifyRanking: a Discord target gets embeds, any other target text split at 2,000 code points; rankingAlert: the text's names cut to 64 runes, as an alert's)
icon/gen.go — chain icons: SVG and PNG with the chain's abbreviation and colour (/icon.svg, /icon-*.png, /apple-touch-icon.png; the manifest's colour)
service-worker.js — shows a push and opens its url on a tap
analytics.go — Optional third-party analytics snippet (--analytics), injected before </body>; off by default
index.html — The dashboard's markup and CSS; its script is the modules in js/ (embedded via go:embed, vanilla JS, no framework)
static.go — GET/HEAD /js/<file>.js from the embedded js/ and /data/<file>.json from data/: `Cache-Control: no-cache`, content ETag (304 on a match), 405 for other methods
data/ — country-borders.json: the location form's country borders (see Country borders), written by tools/countryborders, committed
js/ — the page's ES modules, entry `main.js` (see Module map)
types/ — typedefs of the server's answers, named after their Go types (`@typedef` in .js files); type-checked, never served
tsconfig.json — tsc settings: allowJs + checkJs, noEmit, every strict flag
package.json — pins typescript 7.0.2 (`npm ci`); Node 24 (`web/.nvmrc`, CI and local), an older one refused by name (`engines`, `.npmrc`)
modules_test.go — Go tests of the modules (runs `node`): startEach isolation, `$` naming the missing id, no import cycle (imports read as tokens; no subdirectory in `js/`), the scored figures never written better than their values (the higher-is-better rounded down, the lower-is-better up), the Ranking view on an answer it cannot draw (a stub document)
static_test.go — the `/js/` and `/data/` handlers' tests: ETag, 304, 405, what each serves
country_borders_test.go — the country lookup (runs `node`) on a map of its own and on the asset; the asset's codes
server_test.go — also the modulepreload test (`TestIndexPreloadsEveryModule`), `TestJSSyntax` (runs `node`) and `TestJSHasNoLookbehind`
page_test.go — page tests' harness (build tag `page`, playwright-go): TestMain, browser profiles, openPage and its options, traces, the browser clock, which runFor moves with the server's
page_gate_test.go — the gate in front of the routes: holds a request until the test releases or drops it
page_hygiene_test.go — the hygiene checks: console errors and warnings, page errors, failed requests and error answers, against what a test declares
page_scenario_test.go — scenarios: the fake chain (snapshot, block history, peer presence polls, declared locations) the real server starts from, and the ranking's publisher on it
page_push_test.go — the browser's push subscription stub and the fake push service
page_shared*_test.go — every helper more than one area, or the harness, uses, under a name without an area prefix:
page_shared_test.go — the page as a whole: press and point (a tap on a touch screen), the popover, colours and polls, what tests read of the page
page_shared_lists_test.go — the node lists: the validators card's view switch, rows and cards, tables, the map
page_shared_dialogs_test.go — the push menu, the Block ETA cards, the validator page
page_shared_scenarios_test.go — builders and networks, declared locations signed and verified, the ETA chain, the reverse proxy, the settable fill, the server's stored devices
page_shared_history_test.go — block histories and the networks on them
page_<area>*_test.go — page tests by area (Testing lists them)
tools/countryborders/ — writes web/data/country-borders.json from Natural Earth (see Country borders)
server.goruns a publish loop every N seconds (default 5s)- Each cycle calls
fetchSnapshot()which polls every configured source (node/sources.go: Poll): global chain data (status, validators, consensus, signing) comes from the freshest reachable source; peers are unioned across all reachable sources and deduped by node ID (MergePeers: conflicting values take the earlier source, except a peer's connection time, the longest any source reports) before their RPCs are probed. All sources down →snap.Errordrives the "connecting to sources" banner.snap.PeersReadis true when at least one source's/net_infoanswered; a peer only a failing source lists is not listed in that poll.publishrecords the poll whenPeersReadand fills each peer'sPresence(web/presence.go: refreshPresence) before the snapshot is set. The publish loop also rereads the notification config file when it changed, and, once the snapshot is set, sends the lead-time alerts (notifySchedule→push.Manager.EvaluateSchedule: a new halt, once per device or target, and its approach, once per device and once per lead of a target, recorded inpush_sent; the reminders whose lead is met, then dropped, their device kept). Every push or webhook send is bounded by--send-timeout. - The snapshot is broadcast to every WebSocket client as one
updatemessage (see WebSocket protocol) web/js/live.jshandles each message in one pass and updates the DOM in place; the tables, cards and map redraw only when what they show changed- Each cycle also geolocates peers (
geoip) and resolves their cloud provider (asn) — using each peer's resolved public IP only (peers with no usable public IP are geolocated to nothing and bucketed "Unknown" on the map) — and refreshes the missed-24h counts and the 24 h proposals expected / missed from theblocksstore (#7,refreshMissed). This powers the network map and the Country/Provider columns. Validators inherit the country/provider of their correlated peer (matched viaValAddress), so validators no source is peered with have none, unless their operator's declaration shows: each/wsmessage and each/api/status,/api/statsand/api/validatoranswer reads anew the stored declarations whose operatordeclarableKeypasses (shownDeclarations,operatorDeclaration), so a declaration hides while the validator is located by IP (in a blind window, GeoIP not loaded or no/net_inforead, it shows) and stands for its peer's country, coordinates and provider otherwise. - Separately,
eta.Tracker(started inmain.go) runs its own loop on the primary source: every minute, and back to back while backfilling, it reads the chain head, drops the stored history if the chain id changed, reads the halt params, and fetches the missing every-100th block times newest-first./api/etacombines its model with the snapshot's newest block; the dashboard's ETA cards poll/api/etaevery 10 s and tick the countdown locally in between. The link card's target lives in the page link (?eta=&since=&label=), or in the device's reminder (push_reminders) for a page opened without one; the halt card's comes from the chain params; the "original" estimate is recomputed from the stored history as ofsince. - Separately,
blocks.Tracker(started inmain.go) fills the block history from the primary source. Deltas worth knowing:- Each pass: heights up to head − 1 (the head's commit is final only once the next block carries it), then one batch below the stored range;
--history-pacebetween batches while backfilling or catching up, 5 s once complete. A non-canonical commit, or a commit refused within 1,000 blocks of the head (a lagging backend), ends that direction quietly; logged after 2 minutes. A short batch timing out ends the pass. - Floor: set when two answers serve a height and refuse the one below, over 1,000 below the head (a downward batch of 2+ calls opens with the lowest stored height as that witness). A refusal first in its answer (the witness, or a batch of 1) sets no floor; twice in a row at one height, over 1,000 below the head, it pauses the backfill for 10 minutes, logged once; a served downward answer resets it. So a batch of 1 (flag, or a source taking 1 call a batch) never completes at a floor: it pauses there.
floor−1is rechecked after the head at each start until an answer settles it (served clears the floor), never failing a pass. - A batch refused whole halves
--history-batch, rounding up (2 comes before 1), until restart; one timing out, for 10 minutes. HTTP 429 waitsRetry-Afteron every read. - Set changes:
Writerecords a height whose set differs from the stored height below (settling the written height and the one above, so a batch edge is caught either way). After the upward loop, the tracker tells (OnValsetChange, wired topush.Manager.NotifyValsetChangein main.go) the changes above thevalset_told_towatermark, which starts at the first stored high: the backfill and a new chain's first fill never tell. /validatorsonce per newvalidators_hash, plus h−1 and h for a block with round > 0 (rounds kept) and every 1,000th (check only); a set below refused twice, over 1,000 below the head, flags the block; a first refusal, or one nearer, fails the pass. Set-change events from/block_resultsat H−2; a failed read becomes an event gap, retried every 10 minutes, dropped when its events are below the floor.
- Each pass: heights up to head − 1 (the head's commit is final only once the next block carries it), then one batch below the stored range;
- Separately, with
--ranking,ranking.Publisher(started inmain.go) runs a pass every 30 s: it servesReadiness(from the block tracker'sProgress, read from the store when the tracker is built, so a restart's first pass sees the stored history) and the chain's latest stored day. Once ready, with the chain id known, every valoper profile the realm lists read (Server.Valoperswhole) and today's first block stored, it publishes today's ranking intoranking_days, each history read as the window ends (WindowHistory: blocks stored later change no history; keys are linked by every stored event and the current profiles, so a later event or profile can change a link, and with it a score), and tellsOnPublish, wired topush.Manager.NotifyRanking(once per target andchain:day). Today's served day with the same formula and exclusion list is not recomputed.
- Counters, kept by
Writewith each record:blocks_days(day, validator → absent, nil_votes, other_block, proposals_expected, proposals_missed),blocks_gaps(b where block b+1's time is overRestartGapafter b's) andblocks_absence_runs(validator, first, last). Each is filled once for blocks stored before it, while its meta key (days_filled,proposals_filled,gaps_filled,runs_filled) is unset;Resetsets them all. - Blocks in the set are derived, never stored:
blocks_vote_delays.votes(one per precommit present, nil and other block included) + absent. - Proposals: k = the earliest round ≤ the commit round whose expected proposer is the header's; rounds 0..k expected, 0..k−1 missed. Unknown rounds or no match → the height counts nothing.
blocks_dayscounts every height;Summary.ProposalsExpected/ProposalsMissed, the scoring's, count only the heights the validator signed, restart heights b left out. - Recovery after a restart at b, judged on the validator's runs merged across its keys, one of its keys in the set at b−1 and one at b: R = the run holding b, else the one ending at b−1; h = R.Last+1 when R holds b, else b; a sample when fewer than 10 of R's heights are ≤ b−1, R does not start at the stored low (above 1), and one of its keys is in the set at h (else none); pending while block h+1 is not stored (for the ranking,
WindowHistory: while it is above the window's last height + 1); duration = time(h+1) − time(b+1). Every sampled R is a recovery run, the one ending at b−1 before a signed b included. The last 3 samples of the 180-day span areScored. - Outages: runs of 10+ absences (absent or other block; a key's run and the next key's starting right after it, a rotation, are one), recovery runs left out up to 24 h of block time after block b+1 (past that, the rest when it holds 10+).
- Scoring constants, NEVER behind a flag (a change to any bumps
ranking.FormulaVersion, which names them):OutageMin,recoveryRunCap,scoringDays(30 complete UTC days before today),recoveryDays(180),recoveryLast(3) in history.go;RestartGapin gaps.go; the weights, mappings and 168 h minimum in ranking/rank.go. - Identity:
OperatorKeysreads an operator's spans from set events (Added at H opens a key from H, or from 0 when the stored set at H−1 holds it: a power change, which keeps an open span; an applied rotation at H closes the old key at H−1 and opens the new one at H; Removed closes at H−1), plus the profile's key when no event names it./api/validatorresolves?val=to the operator it is, elseOperatorOf(an event naming it), else a profile naming it as signing key, else the key alone (operator "") whenKnownor in the current set; else 404. - Valopers:
valoperRefreshLoop(every 15 min) →refreshValopersreads every profile's render and twovm/qevalreads (KeepRunning,LastRotationHeight) intoServer.valopers, keyed by the operator the registry lists. A failed state read leavesStatenil; a failed or unparsable render keeps the operator's last profile, and a list read in part or not at all keeps every last profile; each logged once a refresh, the unread operators named.Server.Valopersis whole only when the last refresh read the whole list and every operator it lists has a profile, from it or an earlier one: the ranking waits for it.
Maps validator addresses to human-readable monikers. This is critical because Tendermint RPC only returns addresses, not names. Discovery happens through:
- Genesis (RPC) — validator names and the genesis time are seeded at startup by streaming the node's
/genesisendpoint, parsing only the head (the largeapp_stateis never downloaded) - Peer RPC queries — when we query a peer's
/status, we get their validator_info.address + moniker - Node-ID verification — on shared IPs (multiple nodes same IP), the RPC response's node_info.id is checked against the peer's P2P node-id before trusting the mapping
- Correlation — unmatched validators are matched to unmatched peers heuristically
The registry persists to a JSON file (--names flag) so discoveries survive restarts.
Fetches the last N blocks (default 100), extracts:
- Who signed each block (from
/commit's precommits, which finalize that height; one for the block or for nil signs it, an empty slot or one for another block misses it, as in the block history) - Who proposed each block (from
header.proposer_address) - Block timestamps → the chain-wide average block time
- Per validator: missed (absent, or a precommit for another block), nil votes (signed), and the median delay of its precommits from each commit's median time (below), within the blocks it was in the set for
This is a live 100-block window; the commits the node marks canonical (final)
are kept in memory, so a refresh fetches only the heights not yet read final:
one or two when the window slid by one block. A precommit's delay is from block h+1's header time (tm2's weighted median of commit h), the newest commit's from MedianTime. Longer-term missed-block counts come from the
blocks store (Data Flow #7) via MissedByWindows.
/api/status(status.go) — health summary (retrocompatstatus/chain/height/reason/time) plusnetwork,recent_blocks(last 100), and per-peers/validatorscolumn data (a validator's location its shown declaration's,location_declared, else its matched peer's:validatorLocationOf;peersByValAddrkeeps a key's first peer located by IP, aslocatedPeer, else its last)./api/stats(stats.go) — per-validator missed-block windows, provider + country aggregates (a validator counted wherevalidatorLocationOfputs it), validator-set health, Nakamoto coefficient./api/eta(eta.go) —?height=(+sincefor original/drift/trail),?time=, or none for the on-chain halt./api/history(history.go) — the block history's reach (filled);?from=&to=(≤ 1,000 heights): blocks with absent / nil / other-block members, round proposers, flags, set changes, and the validator sets;?days=N(≤ 31): daily vote-delay histograms;?changes=N&before=H(≤ 100): set changes newest first with their diff, paged bynext_before./api/validator(validator.go, validator_timeline.go) —?val=<g1 operator or signing key>: status, keys, moniker, location (reportLocation: the live key's located peer, else the operator's shown declaration, else its matched peer;sourceipordeclared),declarable, profile, timeline (withrecoveringfor a pending recovery), vote-delay edges, days, recoveries (scored), summary, live; 400 malformed, 404 unknown, 503 history off (unreachable in the shipped binary: main always sets the history up). Not paged./api/ranking(ranking.go) —GETonly (405); 404 while--rankingis off;state(readiness),hide_excluded,ranking(the latest published day, null until one is)./api/boot'srankingtells the page whether to offer the view./api/location(location.go) —POSTonly (405), the body the signed document (≤ 16 KB, read under its own deadline,documentReadTimeout, the handler's first step:ReadHeaderTimeoutbounds the headers only, and net/http reads up to 256 KB of a body left unread (by a 405 or an early 503) before it answers; a body late or cut iscould not read the document); 503 without a store (unreachable in the shipped binary), while the block history has not read the chain id, while the validator set is unknown (validator set unknown) or while the operator's valopers profile is unread, before the first read or missed by a partial one (validator profiles not read yet, fromvalopersWhole): an unknown state never gets a refusal; 400 with the reason:Verify's, another chain,declarableKey's, more than 5 min ahead,ErrNotNewer; 500 logged only for a store failure (no connection to the database within 10 s included); 200 the stored declaration (storedLocation). The provider is stored as the first listed one with its key (listedProviders, which leaves out a peer's spellingValidProviderrefuses, asdeclare.js'slistedProvidersdoes withproviderError), and shown matched again against the list of the moment (shownDeclarations,operatorDeclaration), so a peer that lists it later shares its spelling./api(server.go) — rawSnapshotdump (unstable shape; debugging).- Also:
/badge.svg,/ws,/api/boot,/api/links(links.go: the header links and each status link's state, which the page reads every 30 s),/api/push/*(subscribe: one device per endpoint,""id once it has nothing left,keepthe alert types whose stored alerts a save leaves, as the page sends for the validator alerts while it cannot read the validators;shownthe validators the menu listed, the device's alerts on any other staying unless the save names it; entities 503 while no consensus state is read;/api/push/reminderin reminder.go),/api/notify/*(the config's targets and their alerts, a test send;GNOCKPIT_NOTIFY_TEST_TOKEN).
Everything chain-specific is auto-detected or configurable via flags; the scoring constants are fixed in code on purpose (Validator history). The tool works on any gno.land chain without code changes:
- Chain ID → from RPC
/status - Genesis time + validator names → streamed from RPC
/genesis(head only) - Validator names → also discovered dynamically from peers
NEVER show a declared location where declarableKey refuses: it is the one precedence rule. declare (the POST), shownDeclarations (/ws, /api/status, /api/stats) and operatorDeclaration (/api/validator's location and declarable) all read it; while what it reads is unknown (no set, a profile unread) nothing shows. The page draws /ws's declared (map.js, node-lists.js locOf) and /api/validator's source: "declared" (valpage.js's status line, declare.js's Location section) as sent, NEVER re-deciding it; declare.js offers the form only while /api/validator's declarable is true.
location-record.js mirrors the location package: providerKey, listedProvider and providerError agree with ProviderKey, ListedProvider and ParseMemo's provider check up to Go's Unicode tables (the browser's (and Node's) are newer: a letter only they know is kept by the page, dropped by the server), ON_PREMISE is OnPremise, the memo is ParseMemo's; countries.js's COUNTRY_CODES is CountryCodes(). Change both sides together: location_record_test.go compares them.
web/data/country-borders.json is Natural Earth's 1:50m Admin 0 – Countries, release v5.1.2 (public domain), as tools/countryborders writes it: keyed by ISO_A2_EH, else ISO_A2, when a CountryCodes() code (Somaliland, N. Cyprus and Siachen Glacier are neither: left out); each ring a flat list of longitude, latitude pairs in tenths of a degree, simplified (a point between its neighbours on their line dropped, then one within half a grid step of the edge replacing it: Douglas–Peucker, measured to the edge, the points two countries' rings share kept, so that a shared border stays one line; a ring its simplification would leave enclosing nothing kept as rounded), a ring that encloses nothing at the 0.1° grid dropped; compact JSON, keys sorted. NEVER edit it by hand: regenerate it from the repository's root with go run ./tools/countryborders, which downloads the pinned file (where Go cannot reach it, fetch it with curl and pass -in <file>), and commit it; a rerun writes the same bytes.
country-borders.js reads it once for the page's life, the first time a form opens (readBorders; the data file is no module: NEVER preload it), and a read failing only warns in the console, the next opening reading them again. countryAt is the one country whose rings hold the point rounded to the grid (even-odd, on integers; two: null), else the one whose edge the point lies on (a coast, most of a country a few grid steps wide; none or two: null). A map selection sets the country only then; typed coordinates never do.
rpcGet returns a *node.HTTPStatusError (with RetryAfter) for a non-2xx answer; rpcGetJSON wraps a *node.RPCError for a JSON-RPC error envelope, which gno sends with HTTP 200 (e.g. a height out of range). node.IsRefusal tells a node refusing a call (JSON-RPC error) from one failing to answer (transport error, HTTP error status). Decode RPC results through rpcGetJSON (one call) or rpcBatch (a batch: a refusal of the whole batch is a wrapped *RPCError, a call's own error is in its answer) so neither passes silently.
web/index.html holds the markup and CSS; its script is the ES modules of web/js/. No build step, no bundler, no framework, no runtime dependencies; tsc is a check only (noEmit). index.html, service-worker.js, js/ and data/ are embedded via go:embed.
Serving: /js/<file>.js, and /data/<file>.json the page reads, have Cache-Control: no-cache and a content ETag (static.go), 405 for methods but GET and HEAD; index.html is no-store. The service worker caches nothing (no fetch handler).
The only thing that may add an external origin to that page is --analytics
(web/analytics.go), which splices a provider snippet in just above </body> as the page is
served. It is off by default and must stay that way: most gnockpits watch their operator's own
validator, so the default dashboard has to report to nobody. --analytics-domain moves that
provider's script and pixel to a custom domain and adds no origin of its own. Keep the page
self-contained otherwise.
| Module | Holds |
|---|---|
main.js |
Entry: imports every feature, calls startEach([[name, start], …]) |
start.js |
startEach: runs each start in order; a throw is logged <name> did not start: and the rest still run |
state.js |
live: the state features share (last votes, peers, status, recent blocks, clock offset, genesis, dataSeen, this device's push id and the push key, …) |
dom.js |
$(id) throws missing #<id>, or #<id> is no HTML element; $svg(id) likewise for an SVG element; $in(root, selector) throws missing <selector>, or <selector> is no HTML element; setText, mkEl, mkLink, clearChildren. A lookup that may miss calls document.getElementById itself |
present.js |
present(x): an indexed read that cannot miss; throws on undefined |
read.js |
boundedRead(ms, read) (abort + TimeoutError), failureMessage(e), errorOf(body) (a JSON body's error text or null) |
storage.js, collate.js, format.js, countries.js, country-borders.js, names.js, focus.js, pointer.js, ages.js, location-record.js, valpage-blocks.js |
Helpers (pointer.js and ages.js also have a start): refusable localStorage, name/column ordering, value formatting, country names, flags and codes, the country borders' read and the country a point lies in, validator naming and links, focus, pointer position, server-clock ages, a declared location's record, document and gnokey snippet, the validator page's section and ⓘ (section, info) |
live.js, boot.js, sync.js, timeline.js, ranking.js, eta.js, valpage.js, alerts.js, header-links.js, declare.js |
Features that talk to the server: /ws, /api/boot, /api/history, /api/history?changes=, /api/ranking, /api/eta and the planner, /api/validator, push, /api/links, POST /api/location (declare.js: the validator page's Location section, its form and the commands that sign the document, which valpage.js renders and reads again after a stored declaration; a declared location's ⓘ, declaredInfo) |
node-lists.js, map.js, network-state.js, recent-blocks.js, sections.js, popover.js, copy.js, highlight.js, country-highlight.js, ranking-help.js |
The cards and the page mechanics: tables and cards, map, Network State, Recent Blocks, folding sections, popover, click to copy, cross-highlights, the Ranking view's popovers and dialog |
Rules for adding code to the page, each ending with what enforces it:
- Put it in the module of its feature; a helper two features use goes in a helper module. New module: add its
importandstartEachentry tomain.jsand a<link rel="modulepreload" href="/js/<file>.js">toindex.html(preload:TestIndexPreloadsEveryModule;main.jsandstartEach: unenforced). - The top level declares and looks up only. Every side effect (listeners, timers, requests, DOM writes) goes in an exported
start(), whichmain.jscalls throughstartEach(unenforced). main.jslists the features in the orderstartEachruns them, which is the order their listeners and first draws register: insert a new feature where it must come relative to the others, and never reorder an existing one. Astartmust not rely on another feature having started unless that order guarantees it: eta's reminder awaitswhenPushReady(), which alerts'startsets, so alerts starts before eta (page tests).- Look up an element the page needs with
$(id),$svg(id)(an SVG element) or$in(root, selector), which throw naming it; calldocument.getElementByIdonly where its absence is real and handled. Read an index that cannot miss withpresent(x)(tsc,TestLookupsNameTheMissingElement). - State two modules share lives on
live(state.js) and is read and written aslive.<name>. A module-levelletanother module needs is a defect (unenforced). - No regex lookbehind,
(?<=or(?<!: Safari before 16.4 cannot parse one, and a module it cannot parse stops every module (TestJSHasNoLookbehind). - No import cycles (
TestModulesFormNoCycle). No writes to an imported binding: write throughliveor an exported function (tsc). - Types are JSDoc (tsc). A server answer's typedef goes in
web/types/, named after its Go type, with its JSON tags (omitemptyoromitzero= optional; a pointer, or a slice the server can leave nil, = nullable). Noany, no@ts-ignore/@ts-expect-error(unenforced). - A wide query negates its narrow one,
not all and (max-width: N), never(min-width: N+1), which a fractional width (browser zoom) between the two escapes; JS asks the same query throughmatchMedia, neverinnerWidth(unenforced). - A default must show as the first paint, before any module runs: a layout in CSS without the class the JS adds, a control's state in the markup (
checked) (unenforced;TestPageNetworkCompactBeforeTheScriptscovers the Network State's phone default,TestPageRecentBlocksCompactBeforeTheScriptsRecent Blocks' compact box). make typecheckbefore any commit touchingweb/js/orweb/types/(tsc).
timeline.jsholds the switch (Live, Timeline, Ranking) and the Timeline;ranking.jsthe Ranking view, whichsetViewstarts and stops throughrankingShown(explain)/rankingHidden().- The Ranking button is
hiddenuntil an/api/bootanswer saysranking: true:boot.jscallsofferRankingon every answer. NEVER infer the ranking from a failing/api/ranking. - The card opens on
?view=live|timeline|ranking, else the savedgnockpit-validators-view, else Live. A Ranking view so chosen (by?view=or saved) waits for the first answer saying on, Live showing meanwhile; an answer saying off moves the Ranking view to Live, and the next saying on brings it back, unless the viewer picked a view.?view=ranking&explain(the Discord alert's "More info ↗") also opens the "How is this ranked?" dialog, once, when that Ranking view first draws a ranking (timeline.jsholds the wait until it shows that view, and passes it on,rankingShown(true);ranking.jsopens the dialog,openExplainer, once it has put the ranking on the panel, unless another dialog (.eta-modal.open: a validator's page, the alerts, the planner) is open by then, which ends the wait with the dialog closed; a failed read, a state without a ranking or a draw that throws leaves it waiting; the next showing or hiding of the view takes it back, so leaving the Ranking view before its first drawing, the fallback to Live included, or a click on the switch drops the dialog for that page load);explaincounts only besideview=ranking. Once the Ranking view's wait ends, the dialog opened or not,ranking.jstakesexplainout of the address (endExplain), and, onpopstate, out of every entry the reader goes back or forward to after (dropExplain: a validator page opened during the wait pushes an entry over one holding it),view=kept (history.replaceState(history.state, …)): the links built from the address (valpage'surlWith, the ETA card's copy link) never ask for the dialog again. Only a click on the switch saves a view: never?view=(the daily alert links?view=ranking), nor a view the card shows on its own. A click also takes?view=andexplainout of the address (history.replaceState(history.state, …), keeping the validator page's entry state), so a reload opens the view clicked. - The Ranking view reads
/api/rankingwhen shown and every 60 s (10 s bound), giving up the read in flight when it hides or reads anew; a click on Ranking while it shows reads anew. An answer equal to the one shown redraws nothing; a redraw gives the keyboard's focus back to its control (focusPlaceIn/focusPlace:data-keyon the meta line's controls, the header row, each operator's row and card). ranking-help.jsholds the Ranking view's explanations, whichranking.jscalls on each draw: the header popovers (on a card, the rank's and the values' labels carry them:button.info-btns, as the table's headers; the page's older ⓘ spans elsewhere stay spans), the value, score, not-ranked-yet and hidden-count popovers (popRows; the hidden count abutton.info-btntoo), and the "How is this ranked?" dialog (#ranking-modal, the.eta-modalparts, opened byopenExplainer, which hides an open popover first and which one delegated click onbutton.rk-howcalls, as doesranking.jsfor?explain; closing it focusesbutton.rk-how, or, when the page shows none, as with the Validators section folded, that section's title). The popovers write/api/ranking's figures and counts derived from them (counted blocks, uptime, missed share, the day ranked from), never a score, rounded as the cells. Every scored figure, on the view and on the validator page, is written never better than its value (format.js): an uptime down (pctDown), a sub-score down to 3 decimals (subScoreText), points down to one decimal and the weight's text only at full marks (pointsText; a weight half-up,weightText), a score down to one decimal (scoreText, as ranking/digest.go writes it), a missed share up (pctUp), a recovery time up (durationUpText); a band reads the value, never the figure written. The dialog's copy is static inindex.html; its window, heights and formula fill from the ranking drawn, its curl line fromlocation.origin.- A change to any scoring constant bumps
FormulaVersionand updatesranking-help.js(WEIGHTS50/20/20/10,MIN_HOURS168, its copy),ranking.js's copy (the 180 days of the filling and unavailable lines, the separator's "(7 days)"),#ranking-modal's copy, and README's Ranking section:/api/rankingpublishes only the weights after redistribution.
The binary serves the embedded js/: without the dev proxy, stop gnockpit and run it again with go run . (and its flags) after each edit, then reload. The dev proxy (local tooling, not in the repo) serves web/js/ from disk with no-store: an edit shows on reload, no rebuild.
make typecheck: npm ci in web/ (Node 24 (web/.nvmrc)), then tsc 7.0.2 over web/js and web/types with strict, noImplicitReturns, noUnusedLocals, noUnusedParameters, noFallthroughCasesInSwitch, noUncheckedIndexedAccess, exactOptionalPropertyTypes, and allowUnreachableCode and allowUnusedLabels off. Prints nothing on success, exits non-zero on a finding. CI runs it as the typecheck job.
{type, data}, two types only: snapshot (on connect, once a snapshot exists) and update (each publish). Both carry liveData (server.go: buildLiveData); a new field goes there.
| Field | Content |
|---|---|
time |
the snapshot's fetch time, 15:04:05, server-local |
status, votes |
always present; null while every source is down, votes also when the consensus read fails; without status the last head stays |
peers |
always present; null while every source is down, [] when none is seen: the page empties the tables and hides the map either way |
checks |
apphash_last, val_address, val_pubkey, hide_sources, system.genesis_time; system.node_time is s.now() as the message is built, to the ms (historyTime): the page sets its clock by it |
signing |
left out when nil |
declared |
shownDeclarations by signing key, each a declaredNode (name from the registry, operator, country, lat, lon, provider, at); {} when none, never null |
/api's dump keeps the fetch's node time, to the second (collectSystemInfo).
renderNodeLists() (web/js/node-lists.js: validators and peers tables and cards) redraws only when nodeListsFingerprint() changed; it saves window.scrollY and the focused cell or card control before the redraw and restores both after.
web/js/sections.js. Each card's <h2 data-section="name"> holds a <button> filling the title that folds the section: .collapsed on the h2, aria-expanded on the button. Folded keys persist in localStorage under gnockpit-collapsed, or gnockpit-collapsed-mobile when the window was ≤ 768 px wide at load.
- Add the fetch method to
node/client.go - Add types to
node/types.go(or beside their read, as inchain.go) - Call it in
web/server.go: fetchSnapshot() - Add it to
liveData(web/server.go: buildLiveData), which both WebSocket messages send - Type it in
web/types/server.js(LiveData, or the answer's own typedef) and read it in themessagelistener (web/js/live.js)
The value comes from a node.Peer field (node/types.go): the /ws peers send them all, so a new field needs only filling on the snapshot's path: in fetchSnapshot (web/server.go) or a read it calls (as ConnectedMs, from GetNetInfo through MergePeers), or in publish (as Presence, in refreshPresence, web/presence.go). Step 1 edits web/index.html; steps 2–7 edit web/js/node-lists.js; the node.Peer field gets its typedef in web/types/node.js.
- Header, in
#peers-card's<thead>:<th data-sort="key"><button type="button" class="info-btn" data-popover="…">Label</button></th>(a plain<button type="button">without a popover, as Name).sortByandupdateSortHeaderstake anyth[data-sort](aria-sort, the arrow). Add its<col>to the<colgroup>(widths sum to 100 %) and count it in the loading row'scolspan. A short figure, as Connected, Online and RPC, takes thepeer-figureclass on its<th>and its cell (8 px side padding from 769 px up). - Row: in
renderNodeLists()(node-lists.js), theotherPeersloop builds each row (tr2): append the cell in column order (createCell, or a builder:peerOnlineCell,peerRPCCell,countryCell,providerCell,midTruncCell). emptyRow('no peers', 7): the column count.- Sort: a
peerSortKeybranch in theotherPeers.sortcomparator settingva/vbforcompareSortValues:nullfor a missing value (last either way); a value shown as a name joinspeersByName(compareNames); a column that shows a code when narrow sorts by what it shows, as Country (peerCountryShowsCode, measured before the cells are cleared); a rounded figure sorts by the value it shows, as Connected and Online (connectedShown,onlineShown), so figures that read the same tie and the order agrees with the fingerprint's texts. Ties keepsetPeers' name order. - Card: in
buildPeersCards(), a[label, value]inmakeCard'sdata.minimalfieldsand its property in the peers'makeCard({…})call; acopyLinesline if the card copies it. nodeListsFingerprint(): the field in the peers' list, or its changes never redraw.- Focus: rows and cards are keyed by
peerKeys()(node id, else moniker, else IP and rank, else rank), never by the new value;focusPlaceIn/focusPlacegive the focus back to the same cell's control, so a control in the new cell needs nothing more. - Tests:
peersCol…,peersCardKeys(page_peers_helpers_test.go); inpage_peers_test.go,peersKeyswith TestPagePeersTableHead,peersNetworkRowswith TestPagePeersTableRows,peersNetworkCardswith TestPagePeersCards, TestPagePeersCardCopy,peersSortNetworkwith TestPagePeersSort and TestPagePeersSortMissingLast; TestPageTableHeaderPopovers (its popover), TestPageValidatorsEmpty (the column count), TestPageShownValuesFollowTheirData (the fingerprint).
go test ./...Go tests cover the RPC parsing, the stores, the trackers (fake sources) and the HTTP handlers. go test ./... needs Node on PATH: its node-backed tests (modules_test.go, location_record_test.go, TestJSSyntax) run node, and fail naming it when it is missing.
web/push/discord_examples_test.go (build tag discord) sends one example of every alert, with realistic names, then a set change caught up after downtime and, last, an escaping check of hostile names, each announced by a message, to a test Discord webhook. It reads the first .ignore/dev/discord-test-url found from the package directory upward (Discord's https://discord.com/api/webhooks/<id>/<token> or https://discordapp.com/api/webhooks/<id>/<token> URL, or a discord:// URL used as is; the test skips when none exists) and never prints it. The file holds the webhook's secret, and this repository's .gitignore does not list .ignore/: keep it out of commits (a global gitignore, or .git/info/exclude):
go test -tags discord -count=1 -run TestDiscordExamples ./web/push/make test-gnokey signs with real gnokeys and needs the module proxy or the cache: it builds each version of GNOKEY_VERSIONS (v1.1.0, v1.7.1) into a temporary directory and runs TestLocationSignedByGnokey, which writes the document location-record.js builds with its snippet's here-document (sh, noclobber set, over a stale file), signs it with the snippet's flags and posts it to /api/location. Without GNOCKPIT_GNOKEY the test skips: go test ./... never runs it. Set, it must list a binary (empty entries ignored, gnokeyBinaries), so make test-gnokey GNOKEY_VERSIONS= fails.
The page tests drive web/index.html in Chromium and WebKit against the real server, filled with chain data built in Go. The push tests stub the browser's Push API in an init script (page_push_test.go); every other answer comes from the real handlers, and the test server can hold or drop a request on purpose. They need the browsers, installed once:
make install-browsers
make test-pagemake install-browsers BROWSER_INSTALL_FLAGS= installs the browsers without their system packages (--with-deps). make test-page runs with -count=1: never a cached pass.
CI runs the suite on macOS (page job, macos-26). NEVER move the page job to Linux: Linux's WebKit makes no click of a tap unless an element, not the document, listens to clicks, so the phone profile's tap tests fail there; iPhones and macOS's WebKit turn such a tap into a click.
- A page test MUST NOT depend on font metrics (how many rows fit a box): Linux's fonts fit more than macOS's.
- A page test MUST NOT assume one platform's browser default for a modifier key: branch on
runtime.GOOSwhere it differs.
The full page suite takes about 13 minutes on an M4 Pro (23 on CI's macOS runner): from an agent's shell, run it in the background. One test, on one profile:
go test -tags page -count=1 -run 'TestPageX/desktop' ./web/Page test files by area (the harness files: Architecture tree). An area adds its files as page_<area>[_<part>]_test.go; a part without tests holds the area's helpers or scenarios. An area's own helpers carry its prefix (peers…); a helper a second area uses moves to the shared files (page_shared*_test.go) without one. Dependencies run one way: an area file may use the shared files and the harness, which never use an area file.
Files (page_…_test.go) |
Cover |
|---|---|
markup |
the markup the modules render (ETA cards, planner, dashboard, validator page) carries no inline on* handler |
boot |
head (lang, viewport, title, theme colour, manifest, icons), the chain title, the boot panel and its /api/boot polls, header links and their status dots |
live |
the WebSocket feed: reconnect, the first message, sources down and back, one redraw a frame and only on change (scroll, map); Network State's heights, times and ages on the server's clock (round age, head, block time, stuck tag, clock drift, genesis countdown, chain age) |
network, network_sync |
Network State: rows in full and compact mode, votes, active power, average block time, app hash, voting-power units, proposer, names; _sync: the block-history fill line |
blocks |
Recent Blocks: colours, compact mode, popover, copy, the newest block's flash |
map |
network map: shown once a peer is located (0 coordinates included), clusters, popover, side list and its Country / Provider toggle, the highlight across map, list and tables, two clusters at one point (two groups, or a group's validators and peers) parted; declared validators: their clusters, popover rows and counts in their peers' stead, none while an IP locates them, without a provider, a provider named like an object property, redrawn when only they change and for each value drawn, kept while only their time changes |
mechanics, mechanics_popover, mechanics_helpers |
page-wide: section folding, value flashes, copy and its toast, localStorage refused or unreadable, dialog focus, colours, number and time formats, bands, the stylesheet's breakpoints on either side of their pixel; _popover: the one popover (hover, tap, keyboard ⓘ, placement, following its target), focus kept through table and card redraws |
alerts |
Alerts menu: shown only with push, the form and its rules, save (permission, in flight, timeout, failure), the alerts of validators it does not show (list unread or empty, a validator that left the set) and what the page keeps of the form, test push, focus |
eta, eta_planner, eta_chain, eta_expect |
Block ETA: halt and link cards (countdown, ranges, drift, scenarios, chart, errors, polling, compact view, copy, close); _planner: the planner dialog; _chain: the ETA chain and tracker stand-in; _expect: how a card shows an answer |
reminders, reminders_helpers |
the ETA card's notify button and popover: save, the 409s, remove, read back, restore on load, a fired reminder; poll order: an older poll answered after a newer one |
validators, validators_helpers |
the validators card's Live view: table header and rows (name link and source tag, address, country, provider, voting power and share, SPOF, misses, vote delay, proposals) and their bands, phone cards, both lists' compact switches, sorting (every key, missing values last, English name order), highlights across rows, map and peers, a validator's node found by its address, a declared location (cells, popovers, sort, highlight, cards wrapping it, without a provider, redrawn when only it changes and for each value shown, kept while its day stays), empty lists, an unknown voting power; _helpers: the test networks and their block history |
peers, peers_helpers |
the peers card: table header and rows (name and its highlight, node id and its popover, country, provider and its IP, connected, online and its first-seen popover, the RPC open link and its popover or closed), Online without the store and following the recorded polls, the figures' numbers joined to their units, the figure columns' widths and padding, phone cards (dot, values in pairs and first seen on its own row, connected and online wrapping on cards two abreast, the RPC line link), card copy, hover border, which peers are listed (validators' nodes, --hide-sources, namesakes and nameless peers), sorting (every key, missing values last, figures that read the same tied, each sorted header's arrow joined to its label), markup as text; _helpers: the test networks, their presence polls, a peer's RPC test page and the locators |
timeline, timeline_scenario |
the validators card's Timeline view: toggle, change kinds, layout, polls, older pages, errors, focus |
ranking, ranking_scenario |
the validators card's Ranking view: offered only while /api/boot's ranking is true, the switch, ?view= over the saved view and a click taking it out of the address, ?view=ranking&explain opening the dialog once (after a failed first read or a first answer without a ranking, not again after the ranking goes off and on under held /api/boot polls, not over the validator page ?val= opens at load, a popover opened during the wait hidden, Close over a folded Validators section focusing its title; explain out of the address once the dialog opens, the entry's state kept, or once that validator page drops the dialog, and out of the entry below a validator page opened during the wait when closing the page goes back to it; explain beside another view or none, or with the ranking off, opening nothing; a click on the switch during the wait ending it and taking view and explain out of the address), the fallback to Live when /api/boot turns the ranking off, the saved view with the ranking off; the table (meta line, headers, shared ranks, values coloured by sub-score with their points, a dash without a sub-score) and the cards, the excluded listed or hidden and counted, not ranked yet, a list with no entry; the filling, unavailable and waiting lines; polls, a read without answer, dropped reads given up, the focus kept through a poll and a redraw; the popovers of the headers (a card's on a phone), of each kind of value (a shared rank, three sharing one, several recovery samples, a missed share rounded up with a sub-score and points rounded down, an entry just short of full marks never read better than it is, proposals disabled) and of the hidden count (by the keyboard too); the "How is this ranked?" dialog (its figures, open, close, focus, Tab); _scenario: a ranked chain with a restart, one with three restarts, one missing one proposal of 6,241, a block whose proposals cannot be checked, a history short of the span, a source's floor |
valpage, valpage_helpers |
validator page: opening (name, Timeline row, ?val=), closing, focus, loading and errors, status line, ages, profile and its markdown, link button |
valsections |
validator page: stats lines, Timeline, the scored group, popovers, size |
valcharts, valcharts_helpers, valcharts_scenarios |
validator page charts: uptime, proposals, recovery, vote delay; phone calendars; day axes; bands; keyboard |
declare, declare_helpers |
validator page, a declared location: the status line (coordinates, day, ⓘ), the Location section (the page's last), its ⓘ and the signed document as stored, folded under its toggle, its copy and download, none while an IP locates the validator, markup shown as text; declaring: who is offered it (Declare its location, Update filling the form, Remove; no section while an IP locates the validator or without a profile), the notice that only the operator can declare (its text with the operator's address, operator key bold; on the form and on a removal's steps), the map's click and pin, the coordinates rounded to the grid, the country a point on the map selects once the borders are read (none at sea; one selected by hand, or typed coordinates, left as they are; the borders read once, the form not waiting for them; a read failing), the provider select (Not specified, On premise, the listed providers, Other… and its name field; the listed ones as the form opens, the choice kept; Update's provider listed or under Other…), the document and the commands holding it, alone under step 1 (its text exact, operator key bold; exact, copied), the provider checked as the server does, the section's status after Continue and Remove (no error, emptied as the form opens), the copy button's name, the record on the server's clock (a message's, else the report's before the first), the form's columns, a submission stored (sent once, its note in view and gone with the next submission, Update focused, the status line shown, the map after a publish, its answer cut short, its re-read failing, its answer leaving another validator's page as it is), refused, unavailable (503), lost, answered by a proxy or unanswered (it may be stored), a removal, the keyboard (Latitude focused on opening from it; a click or a tap leaves the focus) |
Page behaviours left untested by ruling, by area:
- Live data: several render requests in one frame making one drawing: not observable without control over the frames.
- Live data: no reconnect before 2 s: a negative check needs a barrier the page does not offer (the reconnect at 2 s is tested).
- Live data: an unknown WebSocket message type: the server sends only
snapshotandupdate, and a made-up frame would fake the API. - Network State: the app hash's
-for a missing hash: the page fills the hash only from a setapphash_last. - Network State sync line: a JSON error answer to a read (
res.okfalse): the history's only JSON error is its 503 when disabled, which never follows a shown line; a proxy's error has no JSON body. - Network State sync line: stored blocks without
from_time: the server sets it wheneverfromis above 0. - Recent Blocks: a missing validator listed by its address alone: the server names an anonymous validator by its address.
- Validators table: a missed count that is not a number: the server always sends both counts as numbers.
- Validators table: Country sorted by country name: its column, narrow on a page at most 1400 px wide, shows and sorts ISO codes.
- Peers table: Connected, Online (30 d) and RPC showing whole from 769 px up (
23 h 59 min,412 d 23 h,100.0 %,closed, each header with its sort arrow): it rests on font metrics. The<colgroup>widths and thepeer-figurepadding were measured in Playwright's chrome-headless-shell; TestPagePeersTableHead and TestPagePeersTableRows pin the widths and the padding. - Validators and Peers tables: the keyboard reaching the popovers of the Signing address, Node ID, Missed last 100 and Online cells: a known gap, left by ruling. None of these cells takes the focus, and
popover.jsshows a popover on focus only for an.info-btn. - Validators and Peers tables: Space on a sort header leaving the page unscrolled (ledger Ruling A-D7 Space, on both tables' sort headers): a native button does not scroll the page, and no test catches a scroll there without a fixed wait.
- Timeline view: a change other than genesis adding, removing, repowering and rotating no member: the set hash covers addresses and powers, so it cannot occur.
- Timeline view: bad JSON in a 200 answer: the server's handlers answer JSON, and a proxy in front answers its errors with their status.
- Ranking view: a draw that throws leaving the dialog closed under
?explain: it takes an answer that breaks the server's contract, and a hand-made one would fake the API. - Ranking view: the uptime popover of an entry with no counted block, every block of its window in a recovery run: only an excluded operator joining under 10 blocks before a restart, absent since and within 24 h of it, is one.
- Block ETA:
HTTP <status>for a non-OK JSON answer withouterror: neither gnockpit nor a proxy in front answers one. - Block ETA:
still loadingwithoutback to <day>: the server setshistory.fromwhenever the history is incomplete and has samples. - Validator page:
could not loadfor a JSON error withouterror: every JSON error the server answers carries one. - Validator page:
could not show it: …(drawing a report throws): no real report reaches it, and a hand-made one would fake the API. - Validator page:
openValidatorfor the validator the URL already names (no history entry pushed): reached only while a close'shistory.back()is in flight, a race input events cannot time. - Validator page: the closing page's own hiding of an open popover: the shared popover code hides it first (target hidden, focus leaving, Escape, a click elsewhere), so no test can tell the two apart.
- Validator page: a chart day with
in_set0: every stored block counts each member of its set absent or voting, so a stored day hasin_set≥ 1. - Validator page: Timeline entries of an unknown kind: the server sends only its eight kinds.
- Validator page, Location section:
could not build the document: the server's time is unknown; reload the page: the server always sends a reportnowthat parses, and a faked one would fake the API. - Validator page: a fault thrown in a report read's callbacks (
.catch(throwOn)on show's and the re-read's chains, the re-read's focus and scroll): no real answer makes them throw. - Alerts and reminders: the browser's own notification permission prompt: the tests stub the Push API and
Notification.permission, which headless Chromium reports denied. - Alerts and reminders: web push in Safari: Playwright's WebKit has no
PushManager, so push runs on Chromium and the phone checks the buttons stay hidden. - Reminders:
.eta-remind-pop[hidden]: it repeats the browser's own[hidden]rule, so no test can fail on it. - Copy: the text WebKit copies: the Global Constraints read the clipboard on Chromium only, so the phone's copies check their toast.
- Every area: presentational CSS (paddings, fonts, gaps, cursors, fixed positions, the planner's 85vh, ellipses, hover-only rules): the suite tests behaviour, not pixels.
Typical systemd service:
[Service]
ExecStart=/usr/local/bin/gnockpit \
--rpc http://127.0.0.1:26657 \
--port 8080 --addr 127.0.0.1 --interval 5sUsually behind a reverse proxy (Caddy/nginx) for TLS.