From 59cc0283117be6b4195afbe857d702e7f8ddba6e Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Nov 2026 20:58:40 +0000 Subject: continuum-party status: a key, a node, a party a line, nodes by their names `status` said each party's keys and nodes in one line, separated by commas, nodes by their IDs alone. Now each goes on a line of its own, indented beneath its heading (party_lines): the keys the version names, which sign votes, proposals, the key set and node list; those of the key set as it counts, which sign writes, or `the same`; `--key`'s marked, and said where it is none of them; and the nodes, each with the name it gave itself (`--alias`) where it did, as the dashboard names nodes. The store and the version are a heading each too, the parties one a line. The names come from GET /events/counts, which gives each party's `names` now (by node ID, of the nodes that gave themselves one), so that a party's session, which reads no /peers, has them. Bash completion reads the parties from the new layout. --- src/api/events.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/api/events.rs') diff --git a/src/api/events.rs b/src/api/events.rs index 06a6e31..81f1481 100644 --- a/src/api/events.rs +++ b/src/api/events.rs @@ -155,7 +155,8 @@ async fn event(State(state): State, Path(id): Path) -> Respons } /// `GET /events/counts`: what counts, as the store reads now: the current version, each -/// party's keys and nodes, what each of those nodes says it speaks and knows (`knows`), +/// party's keys and nodes, the names those nodes gave themselves (`names`, `--alias`), what +/// each of them says it speaks and knows (`knows`), /// the values at places, the members, and the proposals on the /// current version, each with the events proposing it a vote may build on (`proposals`: /// for a checkpoint, those above its heads), the votes on it, the parties @@ -164,6 +165,7 @@ async fn event(State(state): State, Path(id): Path) -> Respons /// (`client::backable`), and, for a checkpoint, what its parties signed that moving there /// refuses (`beside`, `signed_beside`). async fn counts(State(state): State) -> Response { + let aliases = crate::swarm::members::aliases(&state.doc.read().await.doc); with_store(&state, |store| { let read = store.state(); let current = read.current(); @@ -176,11 +178,16 @@ async fn counts(State(state): State) -> Response { .iter() .map(|node| (node.clone(), knows(&state, node))) .collect(); + let names: serde_json::Map = nodes + .iter() + .filter_map(|node| Some((node.clone(), aliases.get(node)?.clone().into()))) + .collect(); ( party.clone(), json!({ "keys": read.keys_of(party, current), "nodes": nodes, + "names": names, "knows": knows, }), ) -- cgit v1.3.1