From 4edd61b9d23a3b27a17f2b86aead1f0d0236ff6a Mon Sep 17 00:00:00 2001 From: Bo QIU <35757521+boqiu@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:05:44 +0800 Subject: [PATCH] return network identity for status rpc (#178) --- node/rpc/src/types.rs | 4 +++- node/rpc/src/zgs/impl.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/node/rpc/src/types.rs b/node/rpc/src/types.rs index b6fa7ec..2cec50a 100644 --- a/node/rpc/src/types.rs +++ b/node/rpc/src/types.rs @@ -7,7 +7,8 @@ use merkle_tree::RawLeafSha3Algorithm; use network::Multiaddr; use serde::{Deserialize, Serialize}; use shared_types::{ - compute_padded_chunk_size, compute_segment_size, DataRoot, FileProof, Transaction, CHUNK_SIZE, + compute_padded_chunk_size, compute_segment_size, DataRoot, FileProof, NetworkIdentity, + Transaction, CHUNK_SIZE, }; use std::collections::HashSet; use std::hash::Hasher; @@ -28,6 +29,7 @@ pub struct Status { pub connected_peers: usize, pub log_sync_height: u64, pub log_sync_block: H256, + pub network_identity: NetworkIdentity, } #[derive(Serialize, Deserialize)] diff --git a/node/rpc/src/zgs/impl.rs b/node/rpc/src/zgs/impl.rs index cd765bd..a961cf4 100644 --- a/node/rpc/src/zgs/impl.rs +++ b/node/rpc/src/zgs/impl.rs @@ -30,6 +30,7 @@ impl RpcServer for RpcServerImpl { connected_peers: self.ctx.network_globals.connected_peers(), log_sync_height: sync_progress.0, log_sync_block: sync_progress.1, + network_identity: self.ctx.network_globals.network_id(), }) }