e004b98eab
The remote signer relies on the `types` and `crypto/bls` crates from Lighthouse. Moreover, a number of tests of the remote signer consumption of LH leverages this very signer, making any important update a potential dependency nightmare. Co-authored-by: Paul Hauner <paul@paulhauner.com>
35 lines
692 B
Rust
35 lines
692 B
Rust
mod cli;
|
|
|
|
use clap::ArgMatches;
|
|
use client::Client;
|
|
use environment::Environment;
|
|
use slog::info;
|
|
use types::EthSpec;
|
|
|
|
pub use cli::cli_app;
|
|
|
|
pub fn run<E: EthSpec>(
|
|
environment: &mut Environment<E>,
|
|
matches: &ArgMatches,
|
|
) -> Result<(), String> {
|
|
let context = environment.core_context();
|
|
let exit = context.executor.exit();
|
|
|
|
info!(
|
|
context.log(),
|
|
"Starting remote signer";
|
|
);
|
|
|
|
let client = environment
|
|
.runtime()
|
|
.block_on(Client::new(context, matches))
|
|
.map_err(|e| format!("Failed to init Rest API: {}", e))?;
|
|
|
|
environment.runtime().spawn(async move {
|
|
exit.await;
|
|
drop(client);
|
|
});
|
|
|
|
Ok(())
|
|
}
|