@@ -32,28 +32,47 @@ config_struct! {
3232 #[ serde( deny_unknown_fields, default ) ]
3333 pub struct BlockDownloaderConfig {
3434 #[ comment_out = true ]
35- /// The size in bytes of the buffer between the block downloader and the place which
36- /// is consuming the downloaded blocks (`cuprated`).
35+ /// The size in bytes of the buffer between the block downloader
36+ /// and the place which is consuming the downloaded blocks (`cuprated`).
3737 ///
38- /// This value is an absolute maximum, once this is reached the block downloader will pause.
38+ /// This value is an absolute maximum,
39+ /// once this is reached the block downloader will pause.
40+ ///
41+ /// Type | Number
42+ /// Valid values | >= 0
43+ /// Examples | 1_000_000_000, 5_500_000_000, 500_000_000
3944 pub buffer_bytes: usize ,
4045
4146 #[ comment_out = true ]
42- /// The size of the in progress queue (in bytes) at which we stop requesting more blocks.
47+ /// The size of the in progress queue (in bytes)
48+ /// at which cuprated stops requesting more blocks.
49+ ///
50+ /// The value is _NOT_ an absolute maximum,
51+ /// the in-progress queue could get much larger.
52+ /// This value is only the value cuprated stops requesting more blocks,
53+ /// if cuprated still has requests in progress,
54+ /// it will still accept the response and add the blocks to the queue.
4355 ///
44- /// The value is _NOT_ an absolute maximum, the in progress queue could get much larger. This value
45- /// is only the value we stop requesting more blocks, if we still have requests in progress we will
46- /// still accept the response and add the blocks to the queue.
56+ /// Type | Number
57+ /// Valid values | >= 0
58+ /// Examples | 500_000_000, 1_000_000_000,
4759 pub in_progress_queue_bytes: usize ,
4860
4961 #[ inline = true ]
50- /// The [`Duration`] between checking the client pool for free peers.
62+ /// The duration between checking the client pool for free peers.
63+ ///
64+ /// Type | Duration
65+ /// Examples | { secs = 30, nanos = 0 }, { secs = 35, nano = 123 }
5166 pub check_client_pool_interval: Duration ,
5267
5368 #[ comment_out = true ]
5469 /// The target size of a single batch of blocks (in bytes).
5570 ///
56- /// This value must be below 100_000_000, it is not recommended to set it above 30_000_000.
71+ /// This value must be below 100_000,000,
72+ /// it is not recommended to set it above 30_000_000.
73+ ///
74+ /// Type | Number
75+ /// Valid values | 0..100_000,000
5776 pub target_batch_bytes: usize ,
5877 }
5978}
@@ -86,7 +105,10 @@ config_struct! {
86105 #[ derive( Debug , Deserialize , Serialize , PartialEq ) ]
87106 #[ serde( deny_unknown_fields, default ) ]
88107 pub struct ClearNetConfig {
89- /// The IP address we should bind to to listen to connections on.
108+ /// The IP address to bind and listen for connections on.
109+ ///
110+ /// Type | IPv4/IPv6 address
111+ /// Examples | "0.0.0.0", "192.168.1.50", "::"
90112 pub listen_on: IpAddr ,
91113
92114 #[ flatten = true ]
@@ -113,24 +135,48 @@ config_struct! {
113135 #[ comment_out = true ]
114136 /// The number of outbound connections to make and try keep.
115137 ///
116- /// Recommended to keep this value above 12.
138+ /// It's recommended to keep this value above 12.
139+ ///
140+ /// Type | Number
141+ /// Valid values | >= 0
142+ /// Examples | 12, 32, 64, 100, 500
117143 pub outbound_connections: usize ,
118144
119145 #[ comment_out = true ]
120- /// The amount of extra connections we can make if we are under load from the rest of Cuprate.
146+ /// The amount of extra connections to make if cuprated is under load.
147+ ///
148+ /// Type | Number
149+ /// Valid values | >= 0
150+ /// Examples | 0, 12, 32, 64, 100, 500
121151 pub extra_outbound_connections: usize ,
122152
123153 #[ comment_out = true ]
124- /// The maximum amount of inbound connections we should allow.
154+ /// The maximum amount of inbound connections to allow.
155+ ///
156+ /// Type | Number
157+ /// Valid values | >= 0
158+ /// Examples | 0, 12, 32, 64, 100, 500
125159 pub max_inbound_connections: usize ,
126160
127161 #[ comment_out = true ]
128- /// The percent of connections that should be to peers we haven't connected to before.
162+ /// The percent of connections that should be
163+ /// to peers that haven't connected to before.
164+ ///
165+ /// 0.0 is 0%.
166+ /// 1.0 is 100%.
167+ ///
168+ /// Type | Floating point number
169+ /// Valid values | 0.0..1.0
170+ /// Examples | 0.0, 0.5, 0.123, 0.999, 1.0
129171 pub gray_peers_percent: f64 ,
130172
131- /// port to use to accept p2p connections.
173+ /// The port to use to accept incoming P2P connections.
174+ ///
175+ /// Setting this to 0 will disable incoming P2P connections.
132176 ///
133- /// Set to 0 if you do not want to accept P2P connections.
177+ /// Type | Number
178+ /// Valid values | 0..65534
179+ /// Examples | 18080, 9999, 5432
134180 pub p2p_port: u16 ,
135181
136182 #[ child = true ]
@@ -175,16 +221,28 @@ config_struct! {
175221 pub struct AddressBookConfig {
176222 /// The size of the white peer list.
177223 ///
178- /// The white list holds peers we have connected to before.
224+ /// The white list holds peers that have been connected to before.
225+ ///
226+ /// Type | Number
227+ /// Valid values | >= 0
228+ /// Examples | 1000, 500, 241
179229 pub max_white_list_length: usize ,
180230
181231 /// The size of the gray peer list.
182232 ///
183- /// The gray peer list holds peers we have been told about but not connected to ourself.
233+ /// The gray peer list holds peers that have been
234+ /// told about but not connected to cuprated.
235+ ///
236+ /// Type | Number
237+ /// Valid values | >= 0
238+ /// Examples | 1000, 500, 241
184239 pub max_gray_list_length: usize ,
185240
186241 #[ inline = true ]
187242 /// The time period between address book saves.
243+ ///
244+ /// Type | Duration
245+ /// Examples | { secs = 90, nanos = 0 }, { secs = 100, nano = 123 }
188246 pub peer_save_period: Duration ,
189247 }
190248}
0 commit comments