@@ -3,6 +3,7 @@ use config::{ConfigError, Map, Source, Value, ValueKind};
3
3
use mithril_common:: chain_observer:: ChainObserverType ;
4
4
use mithril_common:: crypto_helper:: ProtocolGenesisSigner ;
5
5
use mithril_common:: era:: adapters:: EraReaderAdapterType ;
6
+ use mithril_doc:: { Documenter , DocumenterDefault , StructDoc } ;
6
7
use serde:: { Deserialize , Serialize } ;
7
8
use std:: path:: PathBuf ;
8
9
use std:: str:: FromStr ;
@@ -39,16 +40,18 @@ impl FromStr for ExecutionEnvironment {
39
40
}
40
41
41
42
/// Aggregator configuration
42
- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
43
+ #[ derive( Debug , Clone , Serialize , Deserialize , Documenter ) ]
43
44
pub struct Configuration {
44
45
/// What kind of runtime environment the configuration is meant to.
45
46
pub environment : ExecutionEnvironment ,
46
47
47
48
/// Cardano CLI tool path
49
+ #[ example = "`cardano-cli`" ]
48
50
pub cardano_cli_path : PathBuf ,
49
51
50
52
/// Path of the socket used by the Cardano CLI tool
51
53
/// to communicate with the Cardano node
54
+ #[ example = "`/tmp/cardano.sock`" ]
52
55
pub cardano_node_socket_path : PathBuf ,
53
56
54
57
/// Cardano node version.
@@ -61,18 +64,22 @@ pub struct Configuration {
61
64
/// Cardano Network Magic number
62
65
///
63
66
/// useful for TestNet & DevNet
67
+ #[ example = "`1097911063` or `42`" ]
64
68
pub network_magic : Option < u64 > ,
65
69
66
70
/// Cardano network
71
+ #[ example = "`testnet` or `mainnet` or `devnet`" ]
67
72
pub network : String ,
68
73
69
74
/// Cardano chain observer type
70
75
pub chain_observer_type : ChainObserverType ,
71
76
72
77
/// Protocol parameters
78
+ #[ example = "`{ k: 5, m: 100, phi_f: 0.65 }`" ]
73
79
pub protocol_parameters : ProtocolParameters ,
74
80
75
81
/// Type of snapshot uploader to use
82
+ #[ example = "`gcp` or `local`" ]
76
83
pub snapshot_uploader_type : SnapshotUploaderType ,
77
84
78
85
/// Bucket name where the snapshots are stored if snapshot_uploader_type is Gcp
@@ -88,6 +95,7 @@ pub struct Configuration {
88
95
pub server_port : u16 ,
89
96
90
97
/// Run Interval is the interval between two runtime cycles in ms
98
+ #[ example = "`60000`" ]
91
99
pub run_interval : u64 ,
92
100
93
101
/// Directory of the Cardano node store.
@@ -97,6 +105,7 @@ pub struct Configuration {
97
105
pub snapshot_directory : PathBuf ,
98
106
99
107
/// Directory to store aggregator data (Certificates, Snapshots, Protocol Parameters, ...)
108
+ #[ example = "`./mithril-aggregator/stores`" ]
100
109
pub data_stores_directory : PathBuf ,
101
110
102
111
/// Genesis verification key
@@ -120,14 +129,17 @@ pub struct Configuration {
120
129
/// Era reader adapter parameters
121
130
pub era_reader_adapter_params : Option < String > ,
122
131
123
- /// Signed entity types parameters (discriminants names in an ordered comma separated list).
132
+ /// Signed entity types parameters (discriminants names in an ordered comma separated list).
133
+ #[ example = "`MithrilStakeDistribution,CardanoImmutableFilesFull,CardanoStakeDistribution`" ]
124
134
pub signed_entity_types : Option < String > ,
125
135
126
136
/// Compression algorithm used for the snapshot archive artifacts.
137
+ #[ example = "`gzip` or `zstandard`" ]
127
138
pub snapshot_compression_algorithm : CompressionAlgorithm ,
128
139
129
140
/// Specific parameters when [snapshot_compression_algorithm][Self::snapshot_compression_algorithm]
130
141
/// is set to [zstandard][CompressionAlgorithm::Zstandard].
142
+ #[ example = "`{ level: 9, number_of_workers: 4 }`" ]
131
143
pub zstandard_parameters : Option < ZstandardCompressionParameters > ,
132
144
133
145
/// Url to CExplorer list of pools to import as signer in the database.
@@ -284,9 +296,8 @@ impl Configuration {
284
296
Ok ( signed_entity_types)
285
297
}
286
298
}
287
-
288
299
/// Default configuration with all the default values for configurations.
289
- #[ derive( Debug , Clone ) ]
300
+ #[ derive( Debug , Clone , DocumenterDefault ) ]
290
301
pub struct DefaultConfiguration {
291
302
/// Execution environment
292
303
pub environment : ExecutionEnvironment ,
@@ -304,6 +315,7 @@ pub struct DefaultConfiguration {
304
315
pub snapshot_directory : String ,
305
316
306
317
/// Type of snapshot store to use
318
+ #[ example = "`gcp` or `local`" ]
307
319
pub snapshot_store_type : String ,
308
320
309
321
/// Type of snapshot uploader to use
0 commit comments