From 2593edca179e86883e74c7039629564f4ea6ec55 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Oct 2026 01:34:15 +0100 Subject: admit nodeId and addresses in the API --- src/api/stats.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/api/stats.rs') 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, alias: Option, 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, -- cgit v1.3.1