mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Add /node/health endpoint (#1197)
* Start adding health endpoint * Use psutil more * Add get_health test * Expose health to Prom * Update comments * Add /node/health to docs * Update Prom naming
This commit is contained in:
@@ -19,7 +19,7 @@ use url::Url;
|
||||
pub use operation_pool::PersistedOperationPool;
|
||||
pub use proto_array_fork_choice::core::ProtoArray;
|
||||
pub use rest_types::{
|
||||
CanonicalHeadResponse, Committee, HeadBeaconBlock, IndividualVotesRequest,
|
||||
CanonicalHeadResponse, Committee, HeadBeaconBlock, Health, IndividualVotesRequest,
|
||||
IndividualVotesResponse, SyncingResponse, ValidatorDutiesRequest, ValidatorDutyBytes,
|
||||
ValidatorRequest, ValidatorResponse, ValidatorSubscription,
|
||||
};
|
||||
@@ -612,6 +612,12 @@ impl<E: EthSpec> Node<E> {
|
||||
client.json_get(url, vec![]).await
|
||||
}
|
||||
|
||||
pub async fn get_health(&self) -> Result<Health, Error> {
|
||||
let client = self.0.clone();
|
||||
let url = self.url("health")?;
|
||||
client.json_get(url, vec![]).await
|
||||
}
|
||||
|
||||
pub async fn syncing_status(&self) -> Result<SyncingResponse, Error> {
|
||||
let client = self.0.clone();
|
||||
let url = self.url("syncing")?;
|
||||
|
||||
Reference in New Issue
Block a user