From a153955246b70e1075ab647bf3bb4c7240b5e463 Mon Sep 17 00:00:00 2001 From: Bo QIU <35757521+boqiu@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:11:12 +0800 Subject: [PATCH] Add log entry sync info in zgs_getStatus rpc (#200) --- node/rpc/src/types.rs | 1 + node/rpc/src/zgs/impl.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/node/rpc/src/types.rs b/node/rpc/src/types.rs index 2cec50a..be11f54 100644 --- a/node/rpc/src/types.rs +++ b/node/rpc/src/types.rs @@ -29,6 +29,7 @@ pub struct Status { pub connected_peers: usize, pub log_sync_height: u64, pub log_sync_block: H256, + pub next_tx_seq: u64, pub network_identity: NetworkIdentity, } diff --git a/node/rpc/src/zgs/impl.rs b/node/rpc/src/zgs/impl.rs index 7d5934f..fa10ab8 100644 --- a/node/rpc/src/zgs/impl.rs +++ b/node/rpc/src/zgs/impl.rs @@ -26,10 +26,13 @@ impl RpcServer for RpcServerImpl { .get_sync_progress()? .unwrap_or_default(); + let next_tx_seq = self.ctx.log_store.get_store().next_tx_seq(); + Ok(Status { connected_peers: self.ctx.network_globals.connected_peers(), log_sync_height: sync_progress.0, log_sync_block: sync_progress.1, + next_tx_seq, network_identity: self.ctx.network_globals.network_id(), }) }