cometbft_rpc/endpoint/
status.rs1use cometbft::{block, node, validator, AppHash, Hash, Time};
4use serde::{Deserialize, Serialize};
5
6use crate::{dialect::Dialect, request::RequestMessage};
7
8#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
10pub struct Request;
11
12impl RequestMessage for Request {
13 fn method(&self) -> crate::Method {
14 crate::Method::Status
15 }
16}
17
18impl<S: Dialect> crate::Request<S> for Request {
19 type Response = Response;
20}
21
22impl<S: Dialect> crate::SimpleRequest<S> for Request {
23 type Output = Response;
24}
25
26#[derive(Clone, Debug, Deserialize, Serialize)]
28pub struct Response {
29 pub node_info: node::Info,
31
32 pub sync_info: SyncInfo,
34
35 pub validator_info: validator::Info,
37}
38
39impl crate::Response for Response {}
40
41#[derive(Clone, Debug, Deserialize, Serialize)]
43pub struct SyncInfo {
44 #[serde(with = "cometbft::serializers::hash")]
46 pub earliest_block_hash: Hash,
47
48 #[serde(with = "cometbft::serializers::apphash")]
50 pub earliest_app_hash: AppHash,
51
52 pub earliest_block_height: block::Height,
54
55 pub earliest_block_time: Time,
57
58 #[serde(with = "cometbft::serializers::hash")]
60 pub latest_block_hash: Hash,
61
62 #[serde(with = "cometbft::serializers::apphash")]
64 pub latest_app_hash: AppHash,
65
66 pub latest_block_height: block::Height,
68
69 pub latest_block_time: Time,
71
72 pub catching_up: bool,
74}