8bcc931d9b
* Removed separated ipv4 and ipv6 testing * Testing network using chosen core nodes This should have probably been like 20 independent commits... sorry... * SQL migrations for updated schema * SQL updates * Using absolute uptime directly * New uptime calculations * Config entries, more DB work, some cleanup * Additional API query routes * More SQL and API work * Changed `_` to `-` in new routes * Removed good topology from config * Fixed gateways reader yield condition * Initial gateways pinger * Minor cleanup and logging level decreases * Missing trait derivations * Further logging adjustments * Unused commented out import * Claiming additional bandwidth in coconut feature when low * Fixed build with coconut feature * Minimum number of test routes * Making beta/nightly clippy happier
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use crate::storage;
|
|
use rocket::fairing::AdHoc;
|
|
use std::path::PathBuf;
|
|
use std::time::Duration;
|
|
|
|
pub(crate) mod local_guard;
|
|
pub(crate) mod models;
|
|
pub(crate) mod routes;
|
|
pub(crate) mod uptime_updater;
|
|
pub(crate) mod utils;
|
|
|
|
pub(crate) const FIFTEEN_MINUTES: Duration = Duration::from_secs(900);
|
|
pub(crate) const ONE_HOUR: Duration = Duration::from_secs(3600);
|
|
pub(crate) const ONE_DAY: Duration = Duration::from_secs(86400);
|
|
|
|
pub(crate) fn stage(database_path: PathBuf) -> AdHoc {
|
|
AdHoc::on_ignite("SQLx Stage", |rocket| async {
|
|
rocket
|
|
.attach(storage::ValidatorApiStorage::stage(database_path))
|
|
.mount(
|
|
"/v1/status",
|
|
routes![
|
|
routes::mixnode_report,
|
|
routes::gateway_report,
|
|
routes::mixnode_uptime_history,
|
|
routes::gateway_uptime_history,
|
|
routes::mixnode_core_status_count,
|
|
routes::gateway_core_status_count,
|
|
],
|
|
)
|
|
})
|
|
}
|