return network identity for status rpc (#178)

This commit is contained in:
Bo QIU 2024-09-02 16:05:44 +08:00 committed by GitHub
parent e3c199d361
commit 4edd61b9d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -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)]

View File

@ -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(),
})
}