Skip to content

Commit

Permalink
Add network status endpoint to network report REST service.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Jun 19, 2024
1 parent c6e6007 commit 995e4e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subvt-report-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use subvt_types::subvt::ValidatorSummary;

mod era;
mod metrics;
mod network;
mod onekv;
mod session;
mod staking;
Expand Down Expand Up @@ -237,6 +238,7 @@ impl Service for ReportService {
.service(validator::validator_reward_chart_service)
.service(staking::controller_service)
.service(staking::bond_service)
.service(network::get_network_status)
})
.workers(10)
.disable_signals()
Expand Down
7 changes: 7 additions & 0 deletions subvt-report-service/src/network/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use crate::{ResultResponse, ServiceState};
use actix_web::{get, web, HttpResponse};

#[get("/network/status")]
pub(crate) async fn get_network_status(data: web::Data<ServiceState>) -> ResultResponse {
Ok(HttpResponse::Ok().json(data.redis.get_network_status().await?))
}

0 comments on commit 995e4e9

Please sign in to comment.