@@ -32,28 +32,47 @@ config_struct! {
32
32
#[ serde( deny_unknown_fields, default ) ]
33
33
pub struct BlockDownloaderConfig {
34
34
#[ 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`).
37
37
///
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
39
44
pub buffer_bytes: usize ,
40
45
41
46
#[ 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.
43
55
///
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,
47
59
pub in_progress_queue_bytes: usize ,
48
60
49
61
#[ inline = true ]
50
- /// The [`Duration`] between checking the client pool for free peers.
62
+ /// The target size of a single batch of blocks (in bytes).
63
+ ///
64
+ /// This value must be below 100_000,000,
65
+ /// it is not recommended to set it above 30_000_000.
66
+ ///
67
+ /// Type | Number
68
+ /// Valid values | 0..100_000,000
51
69
pub check_client_pool_interval: Duration ,
52
70
53
71
#[ comment_out = true ]
54
- /// The target size of a single batch of blocks (in bytes) .
72
+ /// The duration between checking the client pool for free peers .
55
73
///
56
- /// This value must be below 100_000_000, it is not recommended to set it above 30_000_000.
74
+ /// Type | Duration
75
+ /// Examples | { secs = 30, nanos = 0 }, { secs = 35, nano = 123 }
57
76
pub target_batch_bytes: usize ,
58
77
}
59
78
}
@@ -86,7 +105,10 @@ config_struct! {
86
105
#[ derive( Debug , Deserialize , Serialize , PartialEq ) ]
87
106
#[ serde( deny_unknown_fields, default ) ]
88
107
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", "::"
90
112
pub listen_on: IpAddr ,
91
113
92
114
#[ flatten = true ]
@@ -113,24 +135,48 @@ config_struct! {
113
135
#[ comment_out = true ]
114
136
/// The number of outbound connections to make and try keep.
115
137
///
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
117
143
pub outbound_connections: usize ,
118
144
119
145
#[ 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
121
151
pub extra_outbound_connections: usize ,
122
152
123
153
#[ 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
125
159
pub max_inbound_connections: usize ,
126
160
127
161
#[ 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
129
171
pub gray_peers_percent: f64 ,
130
172
131
- /// port to use to accept p2p connections.
173
+ /// The port to use to accept incoming P2P connections.
132
174
///
133
- /// Set to 0 if you do not want to accept P2P connections.
175
+ /// Setting this to 0 will disable incoming P2P connections.
176
+ ///
177
+ /// Type | Number
178
+ /// Valid values | 0..65534
179
+ /// Examples | 18080, 9999, 5432
134
180
pub p2p_port: u16 ,
135
181
136
182
#[ child = true ]
@@ -175,16 +221,28 @@ config_struct! {
175
221
pub struct AddressBookConfig {
176
222
/// The size of the white peer list.
177
223
///
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
179
229
pub max_white_list_length: usize ,
180
230
181
231
/// The size of the gray peer list.
182
232
///
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
184
239
pub max_gray_list_length: usize ,
185
240
186
241
#[ inline = true ]
187
242
/// The time period between address book saves.
243
+ ///
244
+ /// Type | Duration
245
+ /// Examples | { secs = 90, nanos = 0 }, { secs = 100, nano = 123 }
188
246
pub peer_save_period: Duration ,
189
247
}
190
248
}
0 commit comments