validator client: start http api before genesis (#4714)

## Issue Addressed

On a new network a user might require importing validators before waiting until genesis has occurred.

## Proposed Changes

Starts the validator client http api before waiting for genesis 

## Additional Info

cc @antondlr
This commit is contained in:
João Oliveira
2023-09-15 10:08:30 +00:00
parent b88e57c989
commit d386a07b0c
3 changed files with 51 additions and 50 deletions

View File

@@ -220,14 +220,13 @@ impl<E: EthSpec> LocalValidatorClient<E> {
config.validator_dir = files.validator_dir.path().into();
config.secrets_dir = files.secrets_dir.path().into();
ProductionValidatorClient::new(context, config)
let mut client = ProductionValidatorClient::new(context, config).await?;
client
.start_service()
.await
.map(move |mut client| {
client
.start_service()
.expect("should start validator services");
Self { client, files }
})
.expect("should start validator services");
Ok(Self { client, files })
}
}