mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 11:22:56 +00:00
27 lines
879 B
Rust
27 lines
879 B
Rust
pub mod common;
|
|
pub mod create_validators;
|
|
pub mod import_validators;
|
|
|
|
use clap::{App, ArgMatches};
|
|
use types::ChainSpec;
|
|
|
|
pub const CMD: &str = "validators";
|
|
|
|
pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
|
App::new(CMD)
|
|
.about("Provides commands for managing validators in a Lighthouse Validator Client.")
|
|
.subcommand(create_validators::cli_app())
|
|
.subcommand(import_validators::cli_app())
|
|
}
|
|
|
|
pub async fn cli_run<'a>(matches: &'a ArgMatches<'a>, spec: &ChainSpec) -> Result<(), String> {
|
|
match matches.subcommand() {
|
|
(create_validators::CMD, Some(matches)) => create_validators::cli_run(matches, spec).await,
|
|
(import_validators::CMD, Some(matches)) => import_validators::cli_run(matches).await,
|
|
(unknown, _) => Err(format!(
|
|
"{} does not have a {} command. See --help",
|
|
CMD, unknown
|
|
)),
|
|
}
|
|
}
|