[FR] cardano-testnet: add a status command
I maintainer di solito rispondono entro 2 giorni
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Part of #6687 (subtask 2 of 2). Depends on the manifest sub-issue.
Problem
There is no way to ask a running testnet "are you alive?". A dead node is silent (nothing
monitors the child processes after startup), and a chain stall (#5762) is only visible by
reading logs. Consumers write their own polling loops.
Proposal
cardano-testnet status [--output-dir DIR] [--json] [--timeout SECONDS]
Same --output-dir flag and ./testnet default as the cardano command. Read-only, always
terminates (per-node timeout, default 5s). It reads manifest.json, then asks every node
for its chain tip over its socket (getLocalChainTip — the same lightweight query the
chain watchdog polls with), and reports:
Per node: ok (fresh tip) / stalled (answers, no fresh tip) / unreachable (no answer,
process alive or unknown) / down (no answer, process known dead). The PID check is only a
hint; the socket answer decides.
A tip is "fresh" when younger than max(60s, 2 x forecast horizon) — the same threshold the
chain watchdog already uses for "chain dead" (60s at default settings; status applies it to
the tip's age in one snapshot). One shared number, no new magic value. A node answering
"no blocks yet" (tip at genesis) counts as stalled.
Network state and exit code (answers "what if one node is unhealthy?"):
| state | rule | exit |
|---|---|---|
| RUNNING | every node ok | 0 |
| DEGRADED | chain producing (>= 1 node ok), some node not | 0 |
| STALLED | nodes answer, no fresh tip anywhere | 3 |
| STOPPED | no node answers | 4 |
| NO-TESTNET | no manifest.json in the directory (+ hint) | 5 |
Exit 0 = "the chain is producing blocks" (the rule from #6687), so
cardano-testnet status && run-tests works, even when a relay died. Exit 1 stays what it
already means everywhere: the command itself failed. Strict "all healthy" checks use the
JSON field status == "running".
--json prints one stable object (schemaVersion'd like the manifest, schema in the repo):
overall status, best tip (slot/block/hash/age), and the per-node list with tips and ages.
Polling status until exit 0 is the intended "wait until ready" loop (NO-TESTNET covers
the not-started-yet window; the manifest only appears once the network is ready).
- Lingua principale
- Haskell
- Stelle
- 3.2k
- Fork
- 763
- Merge medio
- 2g 6h
- PR unite (30g)
- 18
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di IntersectMBO/cardano-node
-
Stale
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
IntersectMBO/cardano-node#6597 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
IntersectMBO/cardano-node#6522 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Remove carriage returns in testnet README.md for better diffsForse già presa @palas l’ha presa 3 giorni fa. Aperta
IntersectMBO/cardano-node#6744 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
needs triage type: enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
IntersectMBO/cardano-node#6737 ·
I maintainer di solito rispondono entro 2 giorni
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
IntersectMBO/cardano-node#6734 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di IntersectMBO/cardano-node
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
MorphRule, DataizeRule and ContextualizeRule silently accept unknown YAML keys, unlike rewrite `Rule`Forse già presa @renyamamoto2026-cmyk l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/phino#2107 ·
I maintainer di solito rispondono entro 1 giorno
-
30-minutes algorithm any-language codewars dart easy elixir hackerrank hacktoberfest haskell help wanted interview-prep julia leetcode lua open-source r scala students zig
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 88/100
Huerte/algo-solutions-python#124 ·