diff options
| author | tv <tv@krebsco.de> | 2026-11-20 01:31:09 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 02:39:01 +0100 |
| commit | 6e5afca5a795f3bf5da43f20c81fb70216ae12d8 (patch) | |
| tree | 47ae258bd4c66b4c0deb1278c6086eaf7ff869a2 /src/federation/party/status.rs | |
| parent | 96a733e1ccbf6dab2d69f263d655e487ac54c20d (diff) | |
continuum-party: found by a name, propose name, the name in status
`found` takes the federation's name (`--name`, required), and founds at
revision 2, the first that gives one, unless `--revision` names a later
one; one naming an earlier is an error. `propose name NAME` (and `fork
name`) names the federation anew, the next version following revision 2
too where the current one doesn't, which the preview says. `status` says
the name its current version gives beside the store's ID.
Diffstat (limited to 'src/federation/party/status.rs')
| -rw-r--r-- | src/federation/party/status.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/federation/party/status.rs b/src/federation/party/status.rs index 6094a23..68953fe 100644 --- a/src/federation/party/status.rs +++ b/src/federation/party/status.rs @@ -1,9 +1,9 @@ //! `continuum-party status`: everything about the federation at a node but the values -//! (`values`, `read`). The store; the node; the current version; every party's keys and -//! nodes, when the node last heard from each and what each runs; the proposals on the -//! current version, how they stand and what each does; what the node refused of its own; -//! and the party the client works as: its key, its record against the node, what it signs -//! again; with what may keep votes away. +//! (`values`, `read`). The store, with the federation's name; the node; the current +//! version; every party's keys and nodes, when the node last heard from each and what each +//! runs; the proposals on the current version, how they stand and what each does; what +//! the node refused of its own; and the party the client works as: its key, its record +//! against the node, what it signs again; with what may keep votes away. //! //! As people read it, in colours on a terminal (`Paint`), which may change from release to //! release; with `--json`, the same as one JSON object (`model`), of a format versioned by @@ -124,6 +124,7 @@ async fn model(node: &Node, options: &Options, party: Option<&str>) -> Result<Js "version": { "number": current.number, "hash": current.hash.to_string(), + "name": current.name, "federation": counts["version"]["version"]["federation"], "revision": counts["version"]["revision"], "parties": current.parties.len(), @@ -422,8 +423,13 @@ fn render(model: &JsonValue, paint: &Paint) -> Vec<String> { let number = |value: &JsonValue| value.as_u64().unwrap_or_default(); let store = &model["store"]; + // The federation's name, as its current version gives it, after the store's ID. + let called = match model["version"]["name"].as_str() { + Some(name) => format!(" ({})", paint.paint(Style::Party, name)), + None => String::new(), + }; out.push(format!( - "{} {}", + "{} {}{called}", heading("store"), paint.paint(Style::Id, &text(&store["id"])) )); @@ -782,6 +788,7 @@ mod tests { "version": { "number": 3, "hash": "a7c2", + "name": "krebs", "federation": 1, "revision": {"named": "the base revision"}, "parties": 2, @@ -862,7 +869,7 @@ mod tests { lines.join("\n") ); }; - has("store 6d1e"); + has("store 6d1e (krebs)"); has("the node continuum:9c07 (beta)"); has(" lass's, voting for it by itself"); has("version 3 (a7c2)"); |
