[FR] cardano-testnet: add a status command
メンテナーはふだん 2 日以内に返信
評価
この issue はまだ評価されていません。
説明
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).
- 主要言語
- Haskell
- スター
- 3.2k
- フォーク
- 764
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
IntersectMBO/cardano-node のほかの issue
-
Stale
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
IntersectMBO/cardano-node#6597 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
IntersectMBO/cardano-node#6522 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
IntersectMBO/cardano-node#6755 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Dijkstra PV12 needs triage type: regression
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
IntersectMBO/cardano-node#6748 ·
メンテナーはふだん 2 日以内に返信
-
[cardano-testnet] Enhancements for status command対応中かも @palas が 10 日前に担当しました。 オープン
IntersectMBO/cardano-node#6747 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
IntersectMBO/cardano-node の issue をすべて見る
似ている issue
-
enhancement triage
難易度 1/5 1〜3時間 初心者へのやさしさ 66/100
simplex-chat/simplex-chat#8043 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
haskell/network-uri#92 ·
-
area:zones rules-correctness
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
needs triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
haskell/cabal#12525 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
validateXmirOptions error message is missing the word 'option'対応中かも @opusstudiohq-max が 2 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
objectionary/phino#2256 ·
メンテナーはふだん 1 日以内に返信