cmpb/
archivecenter.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct RegisterResp {
4    #[prost(enumeration = "RegisterStatus", tag = "1")]
5    pub register_status: i32,
6    /// code > 0 means error
7    #[prost(uint32, tag = "2")]
8    pub code: u32,
9    /// default "",else means error msg
10    #[prost(string, tag = "3")]
11    pub message: ::prost::alloc::string::String,
12}
13#[allow(clippy::derive_partial_eq_without_eq)]
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct ArchiveBlockRequest {
16    #[prost(string, tag = "1")]
17    pub chain_unique: ::prost::alloc::string::String,
18    #[prost(message, optional, tag = "2")]
19    pub block: ::core::option::Option<super::common::BlockInfo>,
20}
21#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct SingleArchiveBlockResp {
24    #[prost(uint64, tag = "1")]
25    pub archived_begin_height: u64,
26    #[prost(uint64, tag = "2")]
27    pub archived_end_height: u64,
28    /// code > 0 means error
29    #[prost(uint32, tag = "3")]
30    pub code: u32,
31    /// default "",else means error msg
32    #[prost(string, tag = "4")]
33    pub message: ::prost::alloc::string::String,
34}
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ArchiveBlockResp {
38    #[prost(enumeration = "ArchiveStatus", tag = "1")]
39    pub archive_status: i32,
40    /// code > 0 means error
41    #[prost(uint32, tag = "2")]
42    pub code: u32,
43    /// default "",else means error msg
44    #[prost(string, tag = "3")]
45    pub message: ::prost::alloc::string::String,
46}
47#[allow(clippy::derive_partial_eq_without_eq)]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct ArchiveStatusRequest {
50    #[prost(string, tag = "1")]
51    pub chain_unique: ::prost::alloc::string::String,
52}
53#[allow(clippy::derive_partial_eq_without_eq)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct ArchiveStatusResp {
56    #[prost(uint64, tag = "1")]
57    pub archived_height: u64,
58    #[prost(bool, tag = "2")]
59    pub in_archive: bool,
60    /// code > 0 means error
61    #[prost(uint32, tag = "3")]
62    pub code: u32,
63    /// default "",else means error msg
64    #[prost(string, tag = "4")]
65    pub message: ::prost::alloc::string::String,
66}
67#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct RangeBlocksRequest {
70    #[prost(string, tag = "1")]
71    pub chain_unique: ::prost::alloc::string::String,
72    #[prost(uint64, tag = "2")]
73    pub start_height: u64,
74    #[prost(uint64, tag = "3")]
75    pub end_height: u64,
76}
77#[allow(clippy::derive_partial_eq_without_eq)]
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct BlockByHashRequest {
80    #[prost(string, tag = "1")]
81    pub chain_unique: ::prost::alloc::string::String,
82    #[prost(string, tag = "2")]
83    pub block_hash: ::prost::alloc::string::String,
84    #[prost(enumeration = "OperationByHash", tag = "3")]
85    pub operation: i32,
86}
87#[allow(clippy::derive_partial_eq_without_eq)]
88#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct BlockByHeightRequest {
90    #[prost(string, tag = "1")]
91    pub chain_unique: ::prost::alloc::string::String,
92    #[prost(uint64, tag = "2")]
93    pub height: u64,
94    /// 根据块高读查询信息
95    #[prost(enumeration = "OperationByHeight", tag = "3")]
96    pub operation: i32,
97}
98#[allow(clippy::derive_partial_eq_without_eq)]
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct BlockByTxIdRequest {
101    #[prost(string, tag = "1")]
102    pub chain_unique: ::prost::alloc::string::String,
103    #[prost(string, tag = "2")]
104    pub tx_id: ::prost::alloc::string::String,
105}
106#[allow(clippy::derive_partial_eq_without_eq)]
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct TxDetailByIdRequest {
109    #[prost(string, tag = "1")]
110    pub chain_unique: ::prost::alloc::string::String,
111    #[prost(string, tag = "2")]
112    pub tx_id: ::prost::alloc::string::String,
113    #[prost(enumeration = "OperationByTxId", tag = "3")]
114    pub operation: i32,
115}
116#[allow(clippy::derive_partial_eq_without_eq)]
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct TxDetailByIdResp {
119    /// 区块高度
120    #[prost(uint64, tag = "1")]
121    pub height: u64,
122    /// 区块是否存在
123    #[prost(bool, tag = "2")]
124    pub tx_exist: bool,
125    /// tx确认时间
126    #[prost(uint64, tag = "3")]
127    pub tx_confirmed_time: u64,
128    /// code > 0 means error
129    #[prost(uint32, tag = "4")]
130    pub code: u32,
131    /// default "",else means error msg
132    #[prost(string, tag = "5")]
133    pub message: ::prost::alloc::string::String,
134}
135#[allow(clippy::derive_partial_eq_without_eq)]
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct BlockWithRwSetResp {
138    /// 区块数据
139    #[prost(message, optional, tag = "1")]
140    pub block_data: ::core::option::Option<super::common::BlockInfo>,
141    /// code > 0 means error
142    #[prost(uint32, tag = "2")]
143    pub code: u32,
144    /// default "",else means error msg
145    #[prost(string, tag = "3")]
146    pub message: ::prost::alloc::string::String,
147}
148#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct TxRwSetResp {
151    /// 读写集数据
152    #[prost(message, optional, tag = "1")]
153    pub rw_set: ::core::option::Option<super::common::TxRwSet>,
154    /// code > 0 means error
155    #[prost(uint32, tag = "2")]
156    pub code: u32,
157    /// default "",else means error msg
158    #[prost(string, tag = "3")]
159    pub message: ::prost::alloc::string::String,
160}
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct TransactionResp {
164    /// 交易
165    #[prost(message, optional, tag = "1")]
166    pub transaction: ::core::option::Option<super::common::Transaction>,
167    /// code > 0 means error
168    #[prost(uint32, tag = "2")]
169    pub code: u32,
170    /// default "",else means error msg
171    #[prost(string, tag = "3")]
172    pub message: ::prost::alloc::string::String,
173}
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct StoreStatusResp {
177    #[prost(message, optional, tag = "1")]
178    pub store_status: ::core::option::Option<StoreStatus>,
179    /// code > 0 means error
180    #[prost(uint32, tag = "2")]
181    pub code: u32,
182    /// default "",else means error msg
183    #[prost(string, tag = "3")]
184    pub message: ::prost::alloc::string::String,
185}
186#[allow(clippy::derive_partial_eq_without_eq)]
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct StoreStatus {
189    #[prost(string, tag = "1")]
190    pub chain_unique: ::prost::alloc::string::String,
191    #[prost(message, repeated, tag = "2")]
192    pub store_infos: ::prost::alloc::vec::Vec<StoreInfo>,
193    #[prost(int64, tag = "3")]
194    pub size: i64,
195}
196#[allow(clippy::derive_partial_eq_without_eq)]
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct StoreInfo {
199    #[prost(enumeration = "StoreDataType", tag = "1")]
200    pub r#type: i32,
201    #[prost(message, repeated, tag = "2")]
202    pub file_infos: ::prost::alloc::vec::Vec<FileInfo>,
203    #[prost(int64, tag = "3")]
204    pub size: i64,
205}
206#[allow(clippy::derive_partial_eq_without_eq)]
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct FileInfo {
209    #[prost(string, tag = "1")]
210    pub name: ::prost::alloc::string::String,
211    #[prost(uint64, tag = "2")]
212    pub start: u64,
213    #[prost(uint64, tag = "3")]
214    pub end: u64,
215    #[prost(int64, tag = "4")]
216    pub size: i64,
217}
218#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
219#[repr(i32)]
220pub enum OperationByHash {
221    /// 1. 检查区块是否存在,如果存在返回块高度
222    OperationBlockExists = 0,
223    /// 2. 查询common.Block
224    OperationGetBlockByHash = 1,
225    /// 3. 查询块高度,仅返回
226    OperationGetHeightByHash = 2,
227}
228impl OperationByHash {
229    /// String value of the enum field names used in the ProtoBuf definition.
230    ///
231    /// The values are not transformed in any way and thus are considered stable
232    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
233    pub fn as_str_name(&self) -> &'static str {
234        match self {
235            OperationByHash::OperationBlockExists => "OperationBlockExists",
236            OperationByHash::OperationGetBlockByHash => "OperationGetBlockByHash",
237            OperationByHash::OperationGetHeightByHash => "OperationGetHeightByHash",
238        }
239    }
240    /// Creates an enum from field names used in the ProtoBuf definition.
241    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
242        match value {
243            "OperationBlockExists" => Some(Self::OperationBlockExists),
244            "OperationGetBlockByHash" => Some(Self::OperationGetBlockByHash),
245            "OperationGetHeightByHash" => Some(Self::OperationGetHeightByHash),
246            _ => None,
247        }
248    }
249}
250#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
251#[repr(i32)]
252pub enum OperationByHeight {
253    /// 查询common.Block
254    OperationGetBlockByHeight = 0,
255    /// 仅仅查询common.BlockHeader
256    OperationGetBlockHeaderByHeight = 1,
257}
258impl OperationByHeight {
259    /// String value of the enum field names used in the ProtoBuf definition.
260    ///
261    /// The values are not transformed in any way and thus are considered stable
262    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
263    pub fn as_str_name(&self) -> &'static str {
264        match self {
265            OperationByHeight::OperationGetBlockByHeight => "OperationGetBlockByHeight",
266            OperationByHeight::OperationGetBlockHeaderByHeight => "OperationGetBlockHeaderByHeight",
267        }
268    }
269    /// Creates an enum from field names used in the ProtoBuf definition.
270    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
271        match value {
272            "OperationGetBlockByHeight" => Some(Self::OperationGetBlockByHeight),
273            "OperationGetBlockHeaderByHeight" => Some(Self::OperationGetBlockHeaderByHeight),
274            _ => None,
275        }
276    }
277}
278#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
279#[repr(i32)]
280pub enum OperationByTxId {
281    /// 根据txid查询块高度
282    OperationGetTxHeight = 0,
283    /// 根据txid判断tx是否存在
284    OperationTxExists = 1,
285    /// 根据txid查询tx确认时间
286    OperationGetTxConfirmedTime = 2,
287}
288impl OperationByTxId {
289    /// String value of the enum field names used in the ProtoBuf definition.
290    ///
291    /// The values are not transformed in any way and thus are considered stable
292    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
293    pub fn as_str_name(&self) -> &'static str {
294        match self {
295            OperationByTxId::OperationGetTxHeight => "OperationGetTxHeight",
296            OperationByTxId::OperationTxExists => "OperationTxExists",
297            OperationByTxId::OperationGetTxConfirmedTime => "OperationGetTxConfirmedTime",
298        }
299    }
300    /// Creates an enum from field names used in the ProtoBuf definition.
301    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
302        match value {
303            "OperationGetTxHeight" => Some(Self::OperationGetTxHeight),
304            "OperationTxExists" => Some(Self::OperationTxExists),
305            "OperationGetTxConfirmedTime" => Some(Self::OperationGetTxConfirmedTime),
306            _ => None,
307        }
308    }
309}
310#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
311#[repr(i32)]
312pub enum RegisterStatus {
313    /// 注册成功
314    Success = 0,
315    /// 注册失败,有同一条链其他节点正在注册,可以稍后重试
316    Conflict = 1,
317}
318impl RegisterStatus {
319    /// String value of the enum field names used in the ProtoBuf definition.
320    ///
321    /// The values are not transformed in any way and thus are considered stable
322    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
323    pub fn as_str_name(&self) -> &'static str {
324        match self {
325            RegisterStatus::Success => "RegisterStatusSuccess",
326            RegisterStatus::Conflict => "RegisterStatusConflict",
327        }
328    }
329    /// Creates an enum from field names used in the ProtoBuf definition.
330    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
331        match value {
332            "RegisterStatusSuccess" => Some(Self::Success),
333            "RegisterStatusConflict" => Some(Self::Conflict),
334            _ => None,
335        }
336    }
337}
338#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
339#[repr(i32)]
340pub enum ArchiveStatus {
341    /// 归档区块失败
342    Failed = 0,
343    /// 区块正确,且已经在归档中心存在
344    HasArchived = 1,
345    /// 传输区块正足额,且这个区块正确写入到了归档中心
346    Success = 2,
347}
348impl ArchiveStatus {
349    /// String value of the enum field names used in the ProtoBuf definition.
350    ///
351    /// The values are not transformed in any way and thus are considered stable
352    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
353    pub fn as_str_name(&self) -> &'static str {
354        match self {
355            ArchiveStatus::Failed => "ArchiveStatusFailed",
356            ArchiveStatus::HasArchived => "ArchiveStatusHasArchived",
357            ArchiveStatus::Success => "ArchiveStatusSuccess",
358        }
359    }
360    /// Creates an enum from field names used in the ProtoBuf definition.
361    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
362        match value {
363            "ArchiveStatusFailed" => Some(Self::Failed),
364            "ArchiveStatusHasArchived" => Some(Self::HasArchived),
365            "ArchiveStatusSuccess" => Some(Self::Success),
366            _ => None,
367        }
368    }
369}
370#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
371#[repr(i32)]
372pub enum StoreDataType {
373    /// 1. block file data
374    BlockData = 0,
375    /// 2. compressed file data
376    CompressedData = 1,
377    /// 3. decompress file data
378    DecompressData = 2,
379}
380impl StoreDataType {
381    /// String value of the enum field names used in the ProtoBuf definition.
382    ///
383    /// The values are not transformed in any way and thus are considered stable
384    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
385    pub fn as_str_name(&self) -> &'static str {
386        match self {
387            StoreDataType::BlockData => "BlockData",
388            StoreDataType::CompressedData => "CompressedData",
389            StoreDataType::DecompressData => "DecompressData",
390        }
391    }
392    /// Creates an enum from field names used in the ProtoBuf definition.
393    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
394        match value {
395            "BlockData" => Some(Self::BlockData),
396            "CompressedData" => Some(Self::CompressedData),
397            "DecompressData" => Some(Self::DecompressData),
398            _ => None,
399        }
400    }
401}