mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 11:52:42 +00:00
Link validator_manager into Lighthouse binary
This commit is contained in:
@@ -15,19 +15,28 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
}
|
||||
|
||||
/// Run the account manager, returning an error if the operation did not succeed.
|
||||
pub async fn run<'a, T: EthSpec>(
|
||||
pub fn run<'a, T: EthSpec>(
|
||||
matches: &'a ArgMatches<'a>,
|
||||
env: Environment<T>,
|
||||
mut env: Environment<T>,
|
||||
) -> Result<(), String> {
|
||||
match matches.subcommand() {
|
||||
(validators::CMD, Some(matches)) => validators::cli_run(matches, env).await?,
|
||||
(unknown, _) => {
|
||||
return Err(format!(
|
||||
"{} is not a valid {} command. See --help.",
|
||||
unknown, CMD
|
||||
));
|
||||
}
|
||||
}
|
||||
let context = env.core_context();
|
||||
|
||||
Ok(())
|
||||
context
|
||||
.executor
|
||||
// This `block_on_dangerous` call reasonable since it is at the very highest level of the
|
||||
// application, the rest of which is all async. All other functions below this should be
|
||||
// async and should never call `block_on_dangerous` themselves.
|
||||
.block_on_dangerous(
|
||||
async {
|
||||
match matches.subcommand() {
|
||||
(validators::CMD, Some(matches)) => validators::cli_run(matches, env).await,
|
||||
(unknown, _) => Err(format!(
|
||||
"{} is not a valid {} command. See --help.",
|
||||
unknown, CMD
|
||||
)),
|
||||
}
|
||||
},
|
||||
"validator_manager",
|
||||
)
|
||||
.ok_or("Shutting down")?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user