cmpb/
config.rs

1/// a string k-v pair for config
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ConfigKeyValue {
5    #[prost(string, tag = "1")]
6    pub key: ::prost::alloc::string::String,
7    #[prost(string, tag = "2")]
8    pub value: ::prost::alloc::string::String,
9}
10/// ChainConfig
11#[allow(clippy::derive_partial_eq_without_eq)]
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct ChainConfig {
14    /// blockchain identifier
15    #[prost(string, tag = "1")]
16    pub chain_id: ::prost::alloc::string::String,
17    /// blockchain version
18    #[prost(string, tag = "2")]
19    pub version: ::prost::alloc::string::String,
20    /// member type
21    #[prost(string, tag = "3")]
22    pub auth_type: ::prost::alloc::string::String,
23    /// config sequence
24    #[prost(uint64, tag = "4")]
25    pub sequence: u64,
26    /// encryption algorithm related configuration
27    #[prost(message, optional, tag = "5")]
28    pub crypto: ::core::option::Option<CryptoConfig>,
29    /// block related configuration
30    #[prost(message, optional, tag = "6")]
31    pub block: ::core::option::Option<BlockConfig>,
32    /// core module related configuration
33    #[prost(message, optional, tag = "7")]
34    pub core: ::core::option::Option<CoreConfig>,
35    /// consensus related configuration
36    #[prost(message, optional, tag = "8")]
37    pub consensus: ::core::option::Option<ConsensusConfig>,
38    /// trusted root related configuration
39    /// for alliance members, the initial member's root info of the consortium; for public chain, there is no need to configure
40    /// Key: node_id; value: address, node public key / CA certificate
41    #[prost(message, repeated, tag = "9")]
42    pub trust_roots: ::prost::alloc::vec::Vec<TrustRootConfig>,
43    #[prost(message, repeated, tag = "10")]
44    pub trust_members: ::prost::alloc::vec::Vec<TrustMemberConfig>,
45    /// permission related configuration
46    #[prost(message, repeated, tag = "11")]
47    pub resource_policies: ::prost::alloc::vec::Vec<ResourcePolicy>,
48    #[prost(message, optional, tag = "12")]
49    pub contract: ::core::option::Option<ContractConfig>,
50    /// snapshot module related configuration
51    #[prost(message, optional, tag = "13")]
52    pub snapshot: ::core::option::Option<SnapshotConfig>,
53    /// scheduler module related configuration
54    #[prost(message, optional, tag = "14")]
55    pub scheduler: ::core::option::Option<SchedulerConfig>,
56    /// tx sim context module related configuration
57    #[prost(message, optional, tag = "15")]
58    pub context: ::core::option::Option<ContextConfig>,
59    /// disabled native contracts list for permission control purposes
60    #[prost(string, repeated, tag = "16")]
61    pub disabled_native_contract: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
62    /// gas account config
63    #[prost(message, optional, tag = "18")]
64    pub account_config: ::core::option::Option<GasAccountConfig>,
65    /// vm config
66    #[prost(message, optional, tag = "17")]
67    pub vm: ::core::option::Option<Vm>,
68}
69/// specific permission configuration structure
70#[allow(clippy::derive_partial_eq_without_eq)]
71#[derive(Clone, PartialEq, ::prost::Message)]
72pub struct ResourcePolicy {
73    /// resource name
74    #[prost(string, tag = "1")]
75    pub resource_name: ::prost::alloc::string::String,
76    /// policy(permission)
77    #[prost(message, optional, tag = "2")]
78    pub policy: ::core::option::Option<super::accesscontrol::Policy>,
79}
80/// encryption configuration
81#[allow(clippy::derive_partial_eq_without_eq)]
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct CryptoConfig {
84    /// enable Transaction timestamp verification or Not
85    #[prost(string, tag = "1")]
86    pub hash: ::prost::alloc::string::String,
87}
88/// blockConfig
89#[allow(clippy::derive_partial_eq_without_eq)]
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct BlockConfig {
92    /// enable transaction timestamp verification or Not
93    #[prost(bool, tag = "1")]
94    pub tx_timestamp_verify: bool,
95    /// expiration time of transaction timestamp (seconds)
96    #[prost(uint32, tag = "2")]
97    pub tx_timeout: u32,
98    /// maximum number of transactions in a block
99    #[prost(uint32, tag = "3")]
100    pub block_tx_capacity: u32,
101    /// maximum block size, in MB
102    #[prost(uint32, tag = "4")]
103    pub block_size: u32,
104    /// block proposing interval, in ms
105    #[prost(uint32, tag = "5")]
106    pub block_interval: u32,
107    /// maximum size of transaction's parameter, in MB
108    #[prost(uint32, tag = "6")]
109    pub tx_parameter_size: u32,
110}
111/// Scheduler configuration
112#[allow(clippy::derive_partial_eq_without_eq)]
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct SchedulerConfig {
115    /// for evidence contract
116    #[prost(bool, tag = "1")]
117    pub enable_evidence: bool,
118}
119/// gas account config
120#[allow(clippy::derive_partial_eq_without_eq)]
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct GasAccountConfig {
123    /// for admin address
124    #[prost(string, tag = "1")]
125    pub gas_admin_address: ::prost::alloc::string::String,
126    /// for admin gas count
127    #[prost(uint32, tag = "2")]
128    pub gas_count: u32,
129    /// for gas manager
130    #[prost(bool, tag = "3")]
131    pub enable_gas: bool,
132    /// default gas value for invoke user contract
133    #[prost(uint64, tag = "4")]
134    pub default_gas: u64,
135    /// default gas price per `byte` for invoke user contract
136    #[prost(float, tag = "5")]
137    pub default_gas_price: f32,
138    /// default gas value for install/upgrade user contract
139    #[prost(uint64, tag = "6")]
140    pub install_base_gas: u64,
141    /// default gas price per `byte` for install/upgrade user contract
142    #[prost(float, tag = "7")]
143    pub install_gas_price: f32,
144}
145/// Snapshot configuration
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct SnapshotConfig {
149    /// for the evidence contract
150    #[prost(bool, tag = "1")]
151    pub enable_evidence: bool,
152}
153/// TxSimContext configuration
154#[allow(clippy::derive_partial_eq_without_eq)]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct ContextConfig {
157    /// for the evidence contract
158    #[prost(bool, tag = "1")]
159    pub enable_evidence: bool,
160}
161/// consensus message turbo configuration
162#[allow(clippy::derive_partial_eq_without_eq)]
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct ConsensusTurboConfig {
165    /// switch of consensus message turbo
166    #[prost(bool, tag = "1")]
167    pub consensus_message_turbo: bool,
168    /// retry time of get tx by txIds from txpool
169    #[prost(uint64, tag = "2")]
170    pub retry_time: u64,
171    /// the interval of retry get tx by txIds from txpool(ms)
172    #[prost(uint64, tag = "3")]
173    pub retry_interval: u64,
174}
175/// core module related configuration
176#[allow(clippy::derive_partial_eq_without_eq)]
177#[derive(Clone, PartialEq, ::prost::Message)]
178pub struct CoreConfig {
179    /// [0, 60], the time when the transaction scheduler gets the transaction from the transaction pool to schedule
180    #[prost(uint64, tag = "1")]
181    pub tx_scheduler_timeout: u64,
182    /// [0, 60], the time-out for verification after the transaction scheduler obtains the transaction from the block
183    #[prost(uint64, tag = "2")]
184    pub tx_scheduler_validate_timeout: u64,
185    /// the configuration of consensus message turbo
186    #[prost(message, optional, tag = "3")]
187    pub consensus_turbo_config: ::core::option::Option<ConsensusTurboConfig>,
188    /// enable sender group, used for handling txs with sender conflicts efficiently
189    #[prost(bool, tag = "4")]
190    pub enable_sender_group: bool,
191    /// enable conflicts bit window, used for dynamic tuning the capacity of tx execution goroutine pool
192    #[prost(bool, tag = "5")]
193    pub enable_conflicts_bit_window: bool,
194    /// enable optimize charge gas for the same account transactions
195    #[prost(bool, tag = "6")]
196    pub enable_optimize_charge_gas: bool,
197}
198/// consensus module related configuration
199#[allow(clippy::derive_partial_eq_without_eq)]
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct ConsensusConfig {
202    /// consensus type
203    #[prost(enumeration = "super::consensus::ConsensusType", tag = "1")]
204    pub r#type: i32,
205    /// organization list of nodes
206    #[prost(message, repeated, tag = "2")]
207    pub nodes: ::prost::alloc::vec::Vec<OrgConfig>,
208    /// expand the field, record the difficulty, reward and other consensus algorithm configuration
209    #[prost(message, repeated, tag = "3")]
210    pub ext_config: ::prost::alloc::vec::Vec<ConfigKeyValue>,
211    /// Initialize the configuration of DPOS
212    #[prost(message, repeated, tag = "4")]
213    pub dpos_config: ::prost::alloc::vec::Vec<ConfigKeyValue>,
214}
215/// organization related configuration
216#[allow(clippy::derive_partial_eq_without_eq)]
217#[derive(Clone, PartialEq, ::prost::Message)]
218pub struct OrgConfig {
219    /// organization identifier
220    #[prost(string, tag = "1")]
221    pub org_id: ::prost::alloc::string::String,
222    /// address list owned by the organization
223    /// Deprecated , replace by node_id
224    #[prost(string, repeated, tag = "2")]
225    pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
226    /// node id list owned by the organization
227    #[prost(string, repeated, tag = "3")]
228    pub node_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
229}
230/// trusted root related configuration
231#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct TrustRootConfig {
234    /// oranization ideftifier
235    #[prost(string, tag = "1")]
236    pub org_id: ::prost::alloc::string::String,
237    /// root certificate / public key
238    #[prost(string, repeated, tag = "2")]
239    pub root: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
240}
241#[allow(clippy::derive_partial_eq_without_eq)]
242#[derive(Clone, PartialEq, ::prost::Message)]
243pub struct ContractConfig {
244    #[prost(bool, tag = "1")]
245    pub enable_sql_support: bool,
246    /// disabled native contracts list for permission control purposes
247    #[prost(string, repeated, tag = "2")]
248    pub disabled_native_contract: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
249    /// If it is true, Only creators are allowed to upgrade contract.
250    #[prost(bool, tag = "3")]
251    pub only_creator_can_upgrade: bool,
252}
253#[allow(clippy::derive_partial_eq_without_eq)]
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct TrustMemberConfig {
256    /// member info
257    #[prost(string, tag = "1")]
258    pub member_info: ::prost::alloc::string::String,
259    /// oranization ideftifier
260    #[prost(string, tag = "2")]
261    pub org_id: ::prost::alloc::string::String,
262    #[prost(string, tag = "3")]
263    pub role: ::prost::alloc::string::String,
264    #[prost(string, tag = "4")]
265    pub node_id: ::prost::alloc::string::String,
266}
267#[allow(clippy::derive_partial_eq_without_eq)]
268#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct Vm {
270    #[prost(string, repeated, tag = "1")]
271    pub support_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
272    #[prost(enumeration = "AddrType", tag = "2")]
273    pub addr_type: i32,
274    #[prost(message, optional, tag = "3")]
275    pub native: ::core::option::Option<VmNative>,
276}
277#[allow(clippy::derive_partial_eq_without_eq)]
278#[derive(Clone, PartialEq, ::prost::Message)]
279pub struct VmNative {
280    #[prost(message, optional, tag = "1")]
281    pub multisign: ::core::option::Option<MultiSign>,
282}
283#[allow(clippy::derive_partial_eq_without_eq)]
284#[derive(Clone, PartialEq, ::prost::Message)]
285pub struct MultiSign {
286    /// enable multi sign execute contract from sender
287    #[prost(bool, tag = "1")]
288    pub enable_manual_run: bool,
289}
290#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
291#[repr(i32)]
292pub enum AddrType {
293    Chainmaker = 0,
294    Zxl = 1,
295    Ethereum = 2,
296}
297impl AddrType {
298    /// String value of the enum field names used in the ProtoBuf definition.
299    ///
300    /// The values are not transformed in any way and thus are considered stable
301    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
302    pub fn as_str_name(&self) -> &'static str {
303        match self {
304            AddrType::Chainmaker => "CHAINMAKER",
305            AddrType::Zxl => "ZXL",
306            AddrType::Ethereum => "ETHEREUM",
307        }
308    }
309    /// Creates an enum from field names used in the ProtoBuf definition.
310    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
311        match value {
312            "CHAINMAKER" => Some(Self::Chainmaker),
313            "ZXL" => Some(Self::Zxl),
314            "ETHEREUM" => Some(Self::Ethereum),
315            _ => None,
316        }
317    }
318}
319/// request for log level
320#[allow(clippy::derive_partial_eq_without_eq)]
321#[derive(Clone, PartialEq, ::prost::Message)]
322pub struct LogLevelsRequest {}
323/// response for log level
324#[allow(clippy::derive_partial_eq_without_eq)]
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct LogLevelsResponse {
327    /// 0 success
328    /// 1 fail
329    #[prost(int32, tag = "1")]
330    pub code: i32,
331    /// failure message
332    #[prost(string, tag = "2")]
333    pub message: ::prost::alloc::string::String,
334}
335/// Request for chainmaker version
336#[allow(clippy::derive_partial_eq_without_eq)]
337#[derive(Clone, PartialEq, ::prost::Message)]
338pub struct ChainMakerVersionRequest {}
339/// Response for chainmaker version
340#[allow(clippy::derive_partial_eq_without_eq)]
341#[derive(Clone, PartialEq, ::prost::Message)]
342pub struct ChainMakerVersionResponse {
343    /// 0 success
344    /// 1 fail
345    #[prost(int32, tag = "1")]
346    pub code: i32,
347    #[prost(string, tag = "2")]
348    pub message: ::prost::alloc::string::String,
349    #[prost(string, tag = "3")]
350    pub version: ::prost::alloc::string::String,
351}
352/// rquest for debug configuration
353#[allow(clippy::derive_partial_eq_without_eq)]
354#[derive(Clone, PartialEq, ::prost::Message)]
355pub struct DebugConfigRequest {
356    #[prost(message, repeated, tag = "1")]
357    pub pairs: ::prost::alloc::vec::Vec<ConfigKeyValue>,
358}
359/// Rrsponse for debug configuration
360#[allow(clippy::derive_partial_eq_without_eq)]
361#[derive(Clone, PartialEq, ::prost::Message)]
362pub struct DebugConfigResponse {
363    /// 0 success
364    /// 1 fail
365    #[prost(int32, tag = "1")]
366    pub code: i32,
367    /// failure message
368    #[prost(string, tag = "2")]
369    pub message: ::prost::alloc::string::String,
370}
371/// request for check new block configuration
372#[allow(clippy::derive_partial_eq_without_eq)]
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct CheckNewBlockChainConfigRequest {}
375/// response for check new block configuration
376#[allow(clippy::derive_partial_eq_without_eq)]
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct CheckNewBlockChainConfigResponse {
379    /// 0 success
380    /// 1 fail
381    #[prost(int32, tag = "1")]
382    pub code: i32,
383    /// failure message
384    #[prost(string, tag = "2")]
385    pub message: ::prost::alloc::string::String,
386}
387/// BirdsNest Bird's Nest
388#[allow(clippy::derive_partial_eq_without_eq)]
389#[derive(Clone, PartialEq, ::prost::Message)]
390pub struct TxFilterConfig {
391    /// Transaction filter type
392    #[prost(enumeration = "TxFilterType", tag = "1")]
393    pub r#type: i32,
394    /// Bird's nest configuration
395    #[prost(message, optional, tag = "2")]
396    pub birds_nest: ::core::option::Option<super::common::BirdsNestConfig>,
397    /// Sharding bird's nest configuration
398    #[prost(message, optional, tag = "3")]
399    pub sharding_birds_nest: ::core::option::Option<super::common::ShardingBirdsNestConfig>,
400}
401#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
402#[repr(i32)]
403pub enum TxFilterType {
404    None = 0,
405    BirdsNest = 1,
406    Map = 2,
407    ShardingBirdsNest = 3,
408}
409impl TxFilterType {
410    /// String value of the enum field names used in the ProtoBuf definition.
411    ///
412    /// The values are not transformed in any way and thus are considered stable
413    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
414    pub fn as_str_name(&self) -> &'static str {
415        match self {
416            TxFilterType::None => "None",
417            TxFilterType::BirdsNest => "BirdsNest",
418            TxFilterType::Map => "Map",
419            TxFilterType::ShardingBirdsNest => "ShardingBirdsNest",
420        }
421    }
422    /// Creates an enum from field names used in the ProtoBuf definition.
423    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
424        match value {
425            "None" => Some(Self::None),
426            "BirdsNest" => Some(Self::BirdsNest),
427            "Map" => Some(Self::Map),
428            "ShardingBirdsNest" => Some(Self::ShardingBirdsNest),
429            _ => None,
430        }
431    }
432}