Improve UX whilst VC is waiting for genesis (#1915)

## Issue Addressed

- Resolves #1424

## Proposed Changes

Add a `GET lighthouse/staking` that returns 200 if the node is ready to stake (i.e., `--eth1` flag is present) or a 404 otherwise.

Whilst the VC is waiting for the genesis time to start (i.e., when the genesis state is known), check the `lighthouse/staking` endpoint and log an error if the node isn't configured for staking.

## Additional Info

NA
This commit is contained in:
Paul Hauner
2020-11-23 01:00:22 +00:00
parent 65b1cf2af1
commit 59b2247ab8
4 changed files with 106 additions and 3 deletions

View File

@@ -1815,6 +1815,14 @@ impl ApiTester {
self
}
pub async fn test_get_lighthouse_staking(self) -> Self {
let result = self.client.get_lighthouse_staking().await.unwrap();
assert_eq!(result, self.chain.eth1_chain.is_some());
self
}
}
#[tokio::test(core_threads = 2)]
@@ -2087,5 +2095,7 @@ async fn lighthouse_endpoints() {
.test_get_lighthouse_eth1_deposit_cache()
.await
.test_get_lighthouse_beacon_states_ssz()
.await
.test_get_lighthouse_staking()
.await;
}