hashgraph / hashgraph/solo-weaver

feat(consensus): consensus node list and status commands

Open
#1,106 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3
Forks
0
Avg merge
3d 5h
Merged PRs (30d)
47

Description

Add read-only `consensus node list` and `consensus node status` commands so operators can see which networks (orbits) and consensus nodes are deployed in a cluster and inspect a single node's health — the cluster is now multi-orbit capable (N orbits x M nodes), but there is no way to enumerate or inspect them from the CLI.

Parent epic: #408
Depends on: #1044
Relates to: #1046 (interactive prompting), #1105 (secret-provisioning pause)

### Background
`consensus node install` deploys a ConsensusCapsule per node into an orbit's namespace (namespace == orbit by convention). Multiple orbits can coexist in one cluster. Today the only feedback is the install-time readiness wait; afterwards there is no `list`/`status` surface. Source of truth for status is the cluster: `Orbit` CRs (cluster-scoped) and `ConsensusCapsule` CRs (namespaced) whose `status.phase` (Pending/Running/Active/Failed/Stopped/…) and `status.platformStatus` (STARTING_UP/REPLAYING_EVENTS/ACTIVE/…) the solo-operator maintains.

### `consensus node list`
Enumerate orbits and their consensus nodes across the cluster.
- Columns: `NAMESPACE/ORBIT`, `NODE-ID`, `ACCOUNT`, `PHASE`, `PLATFORM`, `IMAGE` (repo:tag).
- Group by orbit; list every ConsensusCapsule (across namespaces).
- Optional `--namespace` to scope to one orbit.
- `-o json|yaml` for scripting (consistent with the root `--output` convention).

### `consensus node status`
Detailed view of one node: `--namespace --node-id `.
- Fields: capsule name, phase, live platformStatus (+ code), conditions (incl. `UCSidecarReady`), account/weight, image, secret references, config CR refs, lastTransition.
- Clear, decorated error when the capsule/orbit is not found (reasons.NotInstalled / PreconditionNotMet).

### Implementation notes
- Read-only: no workflow, no state mutation. Resolve a kube client and read via the `internal/kube` client (follow the `ResourceExists`/`GetResourceNestedString` pattern; add a cross-namespace "list ConsensusCapsules" path).
- Render through `internal/doctor`/`internal/ui` table styling used elsewhere; honor `--output`.
- Wire under `cmd/cli/commands/consensus/node/` as `list.go` / `status.go`, registered on `nodeCmd`.
- Non-interactive/JSON output must be stable for CI.

### Acceptance criteria
- [ ] `consensus node list` shows all orbits + nodes with phase/platformStatus; `--namespace` scopes to one orbit; `-o json` works.
- [ ] `consensus node status --namespace X --node-id N` shows the full single-node detail incl. conditions.
- [ ] Not-found cases return a decorated, operator-actionable error.
- [ ] Both commands are read-only and touch no local state.
- [ ] Docs: add a `consensus node` command page (or section) documenting list/status + flags.

Contributor guide

Open the contributing guide

Research direction

Start in cmd/cli/commands/consensus/node/ and inspect nodeCmd registration, then follow the internal/kube ResourceExists/GetResourceNestedString patterns and existing internal/doctor/internal/ui renderers. Verify list and status behavior against the stated flags, fields, output modes, read-only requirement, and not-found errors, then add the documented command page or section.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, documentation, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.