-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1079 from dusk-network/clap4
Migrate to `clap` 4.x
- Loading branch information
Showing
16 changed files
with
187 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) DUSK NETWORK. All rights reserved. | ||
|
||
use std::path::PathBuf; | ||
|
||
use clap::builder::PossibleValuesParser; | ||
use clap::Parser; | ||
|
||
use crate::version::VERSION_BUILD; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command( | ||
author="Dusk Network B.V. All Rights Reserved.", | ||
version = &VERSION_BUILD[..], | ||
about = "Rusk server node", | ||
)] | ||
pub struct Args { | ||
/// Sets the profile path | ||
#[clap(long, short, env = "RUSK_CONFIG_TOML", value_parser)] | ||
pub config: Option<PathBuf>, | ||
|
||
/// Output log level | ||
#[clap(long)] | ||
pub log_level: Option<tracing::Level>, | ||
|
||
// Change the log format accordingly | ||
#[clap(long, value_parser = PossibleValuesParser::new(["coloured", "plain", "json"]))] | ||
pub log_type: Option<String>, | ||
|
||
/// Add log filter(s) | ||
#[clap(long)] | ||
pub log_filter: Option<String>, | ||
|
||
/// Sets the profile path | ||
#[clap(long, value_parser)] | ||
pub profile: Option<PathBuf>, | ||
|
||
#[cfg(feature = "ephemeral")] | ||
/// Ephemeral state file (archive) | ||
#[clap(short, long = "state", value_parser)] | ||
pub state_path: Option<PathBuf>, | ||
|
||
#[clap(long, value_parser)] | ||
/// path to blockchain database | ||
pub db_path: Option<PathBuf>, | ||
|
||
#[clap(long, value_parser)] | ||
/// path to encrypted BLS keys | ||
pub consensus_keys_path: Option<PathBuf>, | ||
|
||
#[clap(long)] | ||
/// Delay in milliseconds to mitigate UDP drops for DataBroker service in | ||
/// localnet | ||
pub delay_on_resp_msg: Option<u64>, | ||
|
||
#[clap(long)] | ||
/// Address http server should listen on | ||
pub http_listen_addr: Option<String>, | ||
|
||
#[clap(long, env = "KADCAST_BOOTSTRAP", verbatim_doc_comment)] | ||
/// Kadcast list of bootstrapping server addresses | ||
pub kadcast_bootstrap: Option<Vec<String>>, | ||
|
||
#[clap(long, env = "KADCAST_PUBLIC_ADDRESS", verbatim_doc_comment)] | ||
/// Public address you want to be identified with. Eg: 193.xxx.xxx.198:9999 | ||
/// | ||
/// This is the address where other peer can contact you. | ||
/// This address MUST be accessible from any peer of the network" | ||
pub kadcast_public_address: Option<String>, | ||
|
||
#[clap(long, env = "KADCAST_LISTEN_ADDRESS", verbatim_doc_comment)] | ||
/// Optional internal address to listen incoming connections. Eg: | ||
/// 127.0.0.1:9999 | ||
/// | ||
/// This address is the one bound for the incoming connections. | ||
/// Use this argument if your host is not publicly reachable from other | ||
/// peer in the network (Eg: if you are behind a NAT) | ||
/// If this is not specified, the public address is used for binding | ||
/// incoming connection | ||
pub kadcast_listen_address: Option<String>, | ||
} |
Oops, something went wrong.