summaryrefslogtreecommitdiffstats
path: root/src/api/stats.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-27 01:34:15 +0100
committertv <tv@krebsco.de>2026-10-27 01:34:15 +0100
commit2593edca179e86883e74c7039629564f4ea6ec55 (patch)
tree64257a6f5b1cf79b0e8d39bdfbfadb3e72c78e9c /src/api/stats.rs
parent4cdece6d0f8e25ac154c3fd0f30bca604b08c16a (diff)
admit nodeId and addresses in the API
Diffstat (limited to 'src/api/stats.rs')
-rw-r--r--src/api/stats.rs7
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,