diff options
| author | tv <tv@krebsco.de> | 2026-10-27 01:34:15 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-27 01:34:15 +0100 |
| commit | 027a0920b81e7ee3e0f3eb4f0b3cbbb559133252 (patch) | |
| tree | eb3f0c51ad6594cb1515d28fcec839cdaf69156e /src/api/stats.rs | |
| parent | 3b2773500379d14c7611eacc62c4709c1b406fd3 (diff) | |
admit nodeId and addresses in the API
Diffstat (limited to 'src/api/stats.rs')
| -rw-r--r-- | src/api/stats.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/stats.rs b/src/api/stats.rs index fabbffd..fa64600 100644 --- a/src/api/stats.rs +++ b/src/api/stats.rs @@ -21,7 +21,9 @@ use crate::transport::traffic::PeerTraffic; #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct StatsResponse { - public_key: String, + node_id: String, + /// Where this node can be reached (`Transport::local_addresses`). + addresses: Vec<String>, alias: Option<String>, uptime_secs: u64, ready: bool, @@ -228,7 +230,8 @@ async fn collect(state: &AppState) -> StatsResponse { } StatsResponse { - public_key: state.local_id().to_owned(), + node_id: state.local_id().to_owned(), + addresses: state.transport.local_addresses(), alias: state.alias.clone(), uptime_secs: node.uptime.as_secs(), ready: state.is_ready().await, |
