From beecacf4866811124646e19a2a388bf74752fd0f Mon Sep 17 00:00:00 2001 From: Keyvan Kambakhsh Date: Thu, 17 Nov 2022 18:31:17 +0330 Subject: [PATCH] Expose node pub-key --- src/client/messages.rs | 1 + src/node/api/get_stats.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/client/messages.rs b/src/client/messages.rs index caea9e40..f6bffa4a 100644 --- a/src/client/messages.rs +++ b/src/client/messages.rs @@ -24,6 +24,7 @@ pub struct GetStatsRequest {} #[derive(Deserialize, Serialize, Debug, Clone)] pub struct GetStatsResponse { pub social_profiles: SocialProfiles, + pub address: String, pub height: u64, pub nodes: usize, pub power: u128, diff --git a/src/node/api/get_stats.rs b/src/node/api/get_stats.rs index 23f3a930..eb854d17 100644 --- a/src/node/api/get_stats.rs +++ b/src/node/api/get_stats.rs @@ -11,6 +11,7 @@ pub async fn get_stats( let context = context.read().await; Ok(GetStatsResponse { social_profiles: context.social_profiles.clone(), + address: context.wallet.get_address().to_string(), height: context.blockchain.get_height()?, nodes: context.peer_manager.get_peers().len(), power: context.blockchain.get_power()?,