Skip to content

Commit 995e4e9

Browse files
committed
Add network status endpoint to network report REST service.
1 parent c6e6007 commit 995e4e9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

subvt-report-service/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use subvt_types::subvt::ValidatorSummary;
2121

2222
mod era;
2323
mod metrics;
24+
mod network;
2425
mod onekv;
2526
mod session;
2627
mod staking;
@@ -237,6 +238,7 @@ impl Service for ReportService {
237238
.service(validator::validator_reward_chart_service)
238239
.service(staking::controller_service)
239240
.service(staking::bond_service)
241+
.service(network::get_network_status)
240242
})
241243
.workers(10)
242244
.disable_signals()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use crate::{ResultResponse, ServiceState};
2+
use actix_web::{get, web, HttpResponse};
3+
4+
#[get("/network/status")]
5+
pub(crate) async fn get_network_status(data: web::Data<ServiceState>) -> ResultResponse {
6+
Ok(HttpResponse::Ok().json(data.redis.get_network_status().await?))
7+
}

0 commit comments

Comments
 (0)