Skip to content

Commit f6a1f60

Browse files
committed
Handle changes in the latest version of Confutils
1 parent b992421 commit f6a1f60

File tree

2 files changed

+66
-50
lines changed

2 files changed

+66
-50
lines changed

beacon_chain/conf.nim

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,23 @@ type
8686

8787
BeaconNodeConf* = object
8888
logLevel* {.
89+
desc: "Sets the log level for process and topics (e.g. \"DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none\")"
8990
defaultValue: "INFO"
90-
desc: "Sets the log level for process and topics (e.g. \"DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none\") [=INFO]"
9191
name: "log-level" }: string
9292

9393
logFile* {.
9494
desc: "Specifies a path for the written Json log file"
9595
name: "log-file" }: Option[OutFile]
9696

9797
eth2Network* {.
98-
desc: "The Eth2 network to join [=mainnet]"
98+
desc: "The Eth2 network to join"
99+
defaultValueDesc: "mainnet"
99100
name: "network" }: Option[string]
100101

101102
dataDir* {.
102-
defaultValue: config.defaultDataDir()
103103
desc: "The directory where nimbus will store all blockchain data"
104+
defaultValue: config.defaultDataDir()
105+
defaultValueDesc: ""
104106
abbr: "d"
105107
name: "data-dir" }: OutDir
106108

@@ -131,15 +133,14 @@ type
131133
name: "non-interactive" }: bool
132134

133135
netKeyFile* {.
134-
defaultValue: "random",
135136
desc: "Source of network (secp256k1) private key file " &
136-
"(random|<path>) [=random]"
137+
"(random|<path>)"
138+
defaultValue: "random",
137139
name: "netkey-file" }: string
138140

139141
netKeyInsecurePassword* {.
142+
desc: "Use pre-generated INSECURE password for network private key file"
140143
defaultValue: false,
141-
desc: "Use pre-generated INSECURE password for network private key " &
142-
"file [=false]"
143144
name: "insecure-netkey-password" }: bool
144145

145146
agentString* {.
@@ -155,13 +156,14 @@ type
155156
slashingDbKind* {.
156157
hidden
157158
defaultValue: SlashingDbKind.v2
158-
desc: "The slashing DB flavour to use (v2) [=v2]"
159+
desc: "The slashing DB flavour to use"
159160
name: "slashing-db-kind" }: SlashingDbKind
160161

161162
stateDbKind* {.
162163
hidden
164+
desc: "State DB kind (sql, file)"
163165
defaultValue: StateDbKind.sql
164-
desc: "State DB kind (sql, file) [=sql]"
166+
defaultValueDesc: "sql"
165167
name: "state-db-kind" }: StateDbKind
166168

167169
case cmd* {.
@@ -175,42 +177,45 @@ type
175177
name: "bootstrap-node" }: seq[string]
176178

177179
bootstrapNodesFile* {.
178-
defaultValue: ""
179180
desc: "Specifies a line-delimited file of bootstrap Ethereum network addresses"
181+
defaultValue: ""
180182
name: "bootstrap-file" }: InputFile
181183

182184
listenAddress* {.
185+
desc: "Listening address for the Ethereum LibP2P and Discovery v5 traffic"
183186
defaultValue: defaultListenAddress
184-
desc: "Listening address for the Ethereum LibP2P and Discovery v5 " &
185-
"traffic [=0.0.0.0]"
187+
defaultValueDesc: "0.0.0.0"
186188
name: "listen-address" }: ValidIpAddress
187189

188190
tcpPort* {.
191+
desc: "Listening TCP port for Ethereum LibP2P traffic"
189192
defaultValue: defaultEth2TcpPort
190-
desc: "Listening TCP port for Ethereum LibP2P traffic [=9000]"
193+
defaultValueDesc: "9000"
191194
name: "tcp-port" }: Port
192195

193196
udpPort* {.
197+
desc: "Listening UDP port for node discovery"
194198
defaultValue: defaultEth2TcpPort
195-
desc: "Listening UDP port for node discovery [=9000]"
199+
# defaultValueDesc: 9000
196200
name: "udp-port" }: Port
197201

198202
maxPeers* {.
203+
desc: "The maximum number of peers to connect to"
199204
defaultValue: 160 # 5 (fanout) * 64 (subnets) / 2 (subs) for a heathy mesh
200-
desc: "The maximum number of peers to connect to [=160]"
201205
name: "max-peers" }: int
202206

203207
nat* {.
204208
desc: "Specify method to use for determining public address. " &
205209
"Must be one of: any, none, upnp, pmp, extip:<IP>"
206210
defaultValue: NatConfig(hasExtIp: false, nat: NatAny)
211+
defaultValueDesc: "any"
207212
name: "nat" .}: NatConfig
208213

209214
enrAutoUpdate* {.
210-
defaultValue: false
211215
desc: "Discovery can automatically update its ENR with the IP address " &
212216
"and UDP port as seen by other nodes it communicates with. " &
213217
"This option allows to enable/disable this functionality"
218+
defaultValue: false
214219
name: "enr-auto-update" .}: bool
215220

216221
weakSubjectivityCheckpoint* {.
@@ -226,9 +231,9 @@ type
226231
name: "finalized-checkpoint-block" }: Option[InputFile]
227232

228233
nodeName* {.
229-
defaultValue: ""
230234
desc: "A name for this node that will appear in the logs. " &
231235
"If you set this to 'auto', a persistent automatically generated ID will be selected for each --data-dir folder"
236+
defaultValue: ""
232237
name: "node-name" }: string
233238

234239
graffiti* {.
@@ -237,97 +242,103 @@ type
237242
name: "graffiti" }: Option[GraffitiBytes]
238243

239244
verifyFinalization* {.
240-
defaultValue: false
241245
desc: "Specify whether to verify finalization occurs on schedule, for testing"
246+
defaultValue: false
242247
name: "verify-finalization" }: bool
243248

244249
stopAtEpoch* {.
245-
defaultValue: 0
246250
desc: "A positive epoch selects the epoch at which to stop"
251+
defaultValue: 0
247252
name: "stop-at-epoch" }: uint64
248253

249254
metricsEnabled* {.
255+
desc: "Enable the metrics server"
250256
defaultValue: false
251-
desc: "Enable the metrics server [=false]"
252257
name: "metrics" }: bool
253258

254259
metricsAddress* {.
260+
desc: "Listening address of the metrics server"
255261
defaultValue: defaultAdminListenAddress
256-
desc: "Listening address of the metrics server [=127.0.0.1]"
262+
defaultValueDesc: "127.0.0.1"
257263
name: "metrics-address" }: ValidIpAddress
258264

259265
metricsPort* {.
266+
desc: "Listening HTTP port of the metrics server"
260267
defaultValue: 8008
261-
desc: "Listening HTTP port of the metrics server [=8008]"
262268
name: "metrics-port" }: Port
263269

264270
statusBarEnabled* {.
265-
defaultValue: true
266271
desc: "Display a status bar at the bottom of the terminal screen"
272+
defaultValue: true
267273
name: "status-bar" }: bool
268274

269275
statusBarContents* {.
276+
desc: "Textual template for the contents of the status bar"
270277
defaultValue: "peers: $connected_peers;" &
271278
"finalized: $finalized_root:$finalized_epoch;" &
272279
"head: $head_root:$head_epoch:$head_epoch_slot;" &
273280
"time: $epoch:$epoch_slot ($slot);" &
274281
"sync: $sync_status|" &
275282
"ETH: $attached_validators_balance"
276-
desc: "Textual template for the contents of the status bar"
283+
defaultValueDesc: ""
277284
name: "status-bar-contents" }: string
278285

279286
rpcEnabled* {.
287+
desc: "Enable the JSON-RPC server"
280288
defaultValue: false
281-
desc: "Enable the JSON-RPC server [=false]"
282289
name: "rpc" }: bool
283290

284291
rpcPort* {.
292+
desc: "HTTP port for the JSON-RPC service"
285293
defaultValue: defaultEth2RpcPort
286-
desc: "HTTP port for the JSON-RPC service [=9190]"
294+
defaultValueDesc: "9190"
287295
name: "rpc-port" }: Port
288296

289297
rpcAddress* {.
298+
desc: "Listening address of the RPC server"
290299
defaultValue: defaultAdminListenAddress
291-
desc: "Listening address of the RPC server [=127.0.0.1]"
300+
defaultValueDesc: "127.0.0.1"
292301
name: "rpc-address" }: ValidIpAddress
293302

294303
restEnabled* {.
304+
desc: "Enable the REST (BETA version) server"
295305
defaultValue: false
296-
desc: "Enable the REST (BETA version) server [=false]"
297306
name: "rest" }: bool
298307

299308
restPort* {.
309+
desc: "Port for the REST (BETA version) server"
300310
defaultValue: DefaultEth2RestPort
301-
desc: "Port for the REST (BETA version) server [=5052]"
311+
defaultValueDesc: "5052"
302312
name: "rest-port" }: Port
303313

304314
restAddress* {.
315+
desc: "Listening address of the REST (BETA version) server"
305316
defaultValue: defaultAdminListenAddress
306-
desc: "Listening address of the REST (BETA version) server [=127.0.0.1]"
317+
defaultValueDesc: "127.0.0.1"
307318
name: "rest-address" }: ValidIpAddress
308319

309320
inProcessValidators* {.
310-
defaultValue: true # the use of the nimbus_signing_process binary by default will be delayed until async I/O over stdin/stdout is developed for the child process.
311321
desc: "Disable the push model (the beacon node tells a signing process with the private keys of the validators what to sign and when) and load the validators in the beacon node itself"
322+
defaultValue: true # the use of the nimbus_signing_process binary by default will be delayed until async I/O over stdin/stdout is developed for the child process.
312323
name: "in-process-validators" }: bool
313324

314325
discv5Enabled* {.
326+
desc: "Enable Discovery v5"
315327
defaultValue: true
316-
desc: "Enable Discovery v5 [=true]"
317328
name: "discv5" }: bool
318329

319330
dumpEnabled* {.
331+
desc: "Write SSZ dumps of blocks, attestations and states to data dir"
320332
defaultValue: false
321-
desc: "Write SSZ dumps of blocks, attestations and states to data dir [=false]"
322333
name: "dump" }: bool
323334

324335
directPeers* {.
325336
desc: "The list of priviledged, secure and known peers to connect and maintain the connection to, this requires a not random netkey-file. In the complete multiaddress format like: /ip4/<address>/tcp/<port>/p2p/<peerId-public-key>. Peering agreements are established out of band and must be reciprocal."
326337
name: "direct-peer" .}: seq[string]
327338

328339
doppelgangerDetection* {.
340+
desc: "Whether to detect whether another validator is be running the same validator keys"
329341
defaultValue: true
330-
desc: "Whether to detect whether another validator is be running the same validator keys [=true]"
331342
name: "doppelganger-detection"
332343
}: bool
333344

@@ -341,27 +352,29 @@ type
341352
name: "total-validators" }: uint64
342353

343354
bootstrapAddress* {.
344-
defaultValue: init(ValidIpAddress, "127.0.0.1")
345355
desc: "The public IP address that will be advertised as a bootstrap node for the testnet"
356+
defaultValue: init(ValidIpAddress, "127.0.0.1")
357+
defaultValueDesc: "127.0.0.1"
346358
name: "bootstrap-address" }: ValidIpAddress
347359

348360
bootstrapPort* {.
349-
defaultValue: defaultEth2TcpPort
350361
desc: "The TCP/UDP port that will be used by the bootstrap node"
362+
defaultValue: defaultEth2TcpPort
363+
defaultValueDesc: "9000"
351364
name: "bootstrap-port" }: Port
352365

353366
genesisOffset* {.
354-
defaultValue: 5
355367
desc: "Seconds from now to add to genesis time"
368+
defaultValue: 5
356369
name: "genesis-offset" }: int
357370

358371
outputGenesis* {.
359372
desc: "Output file where to write the initial state snapshot"
360373
name: "output-genesis" }: OutFile
361374

362375
withGenesisRoot* {.
363-
defaultValue: false
364376
desc: "Include a genesis root in 'network.json'"
377+
defaultValue: false
365378
name: "with-genesis-root" }: bool
366379

367380
outputBootstrapFile* {.
@@ -405,22 +418,22 @@ type
405418
case depositsCmd* {.command.}: DepositsCmd
406419
of DepositsCmd.createTestnetDeposits:
407420
totalDeposits* {.
408-
defaultValue: 1
409421
desc: "Number of deposits to generate"
422+
defaultValue: 1
410423
name: "count" }: int
411424

412425
existingWalletId* {.
413426
desc: "An existing wallet ID. If not specified, a new wallet will be created"
414427
name: "wallet" }: Option[WalletName]
415428

416429
outValidatorsDir* {.
417-
defaultValue: "validators"
418430
desc: "Output folder for validator keystores"
431+
defaultValue: "validators"
419432
name: "out-validators-dir" }: string
420433

421434
outSecretsDir* {.
422-
defaultValue: "secrets"
423435
desc: "Output folder for randomly generated keystore passphrases"
436+
defaultValue: "secrets"
424437
name: "out-secrets-dir" }: string
425438

426439
outDepositsFile* {.
@@ -451,9 +464,10 @@ type
451464
desc: "Validator index or a public key of the exited validator" }: string
452465

453466
rpcUrlForExit* {.
454-
name: "rpc-url"
467+
desc: "URL of the beacon node JSON-RPC service"
455468
defaultValue: parseUri("http://localhost:" & $defaultEth2RpcPort)
456-
desc: "URL of the beacon node JSON-RPC service" }: Uri
469+
defaultValueDesc: "http://localhost:9190"
470+
name: "rpc-url" }: Uri
457471

458472
exitAtEpoch* {.
459473
name: "epoch"
@@ -475,8 +489,8 @@ type
475489
name: "udp-port" .}: Port
476490

477491
seqNumber* {.
478-
defaultValue: 1,
479492
desc: "Record sequence number"
493+
defaultValue: 1,
480494
name: "seq-number" .}: uint
481495

482496
fields* {.
@@ -515,17 +529,18 @@ type
515529

516530
ValidatorClientConf* = object
517531
logLevel* {.
532+
desc: "Sets the log level"
518533
defaultValue: "INFO"
519-
desc: "Sets the log level [=INFO]"
520534
name: "log-level" }: string
521535

522536
logFile* {.
523537
desc: "Specifies a path for the written Json log file"
524538
name: "log-file" }: Option[OutFile]
525539

526540
dataDir* {.
527-
defaultValue: config.defaultDataDir()
528541
desc: "The directory where nimbus will store all blockchain data"
542+
defaultValue: config.defaultDataDir()
543+
defaultValueDesc: ""
529544
abbr: "d"
530545
name: "data-dir" }: OutDir
531546

@@ -552,13 +567,14 @@ type
552567
name: "graffiti" }: Option[GraffitiBytes]
553568

554569
stopAtEpoch* {.
555-
defaultValue: 0
556570
desc: "A positive epoch selects the epoch at which to stop"
571+
defaultValue: 0
557572
name: "stop-at-epoch" }: uint64
558573

559574
rpcPort* {.
575+
desc: "HTTP port of the server to connect to for RPC"
560576
defaultValue: defaultEth2RpcPort
561-
desc: "HTTP port of the server to connect to for RPC [=9190]"
577+
defaultValueDesc: "9190"
562578
name: "rpc-port" }: Port
563579

564580
rpcAddress* {.
@@ -568,8 +584,8 @@ type
568584
name: "rpc-address" }: ValidIpAddress
569585

570586
retryDelay* {.
571-
defaultValue: 10
572587
desc: "Delay in seconds between retries after unsuccessful attempts to connect to a beacon node [=10]"
588+
defaultValue: 10
573589
name: "retry-delay" }: int
574590

575591
proc defaultDataDir*(config: BeaconNodeConf|ValidatorClientConf): string =

vendor/nim-confutils

0 commit comments

Comments
 (0)