Files
nym/nym-api/src/main.rs
T
Jędrzej Stuczyński d0692a567a feat: basic performance contract integration [within Nym API] (#5871)
* renamed nym-api config fields

* decouple rewarder startup from network monitor

* additional sections in nym-api config

* removed vesting queries in circulating supply calculator

* added memoized field for last submitted performance measurement

* wip: performance contract refresher

* cleaned up various contract caches

* modified cache refresher to allow passing update fn

* implement performance cache refreshing

* updated lefthook.yml to run cargo fmt

* impl NodePerformanceProvider trait

* dynamically using specific performance provider

* pre warm up performance contract cache and forbid the mode if its empty

* clippy

* introduce fallback setting for performance contract if value for given epoch is not available

* move some functions around
2025-07-01 11:29:50 +01:00

47 lines
1.2 KiB
Rust

// Copyright 2020-2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
use crate::epoch_operations::EpochAdvancer;
use crate::support::cli;
use crate::support::storage;
use ::nym_config::defaults::setup_env;
use clap::Parser;
use mixnet_contract_cache::cache::MixnetContractCache;
use node_status_api::NodeStatusCache;
use nym_bin_common::logging::setup_tracing_logger;
use support::nyxd;
use tracing::{info, trace};
mod circulating_supply_api;
mod ecash;
mod epoch_operations;
mod key_rotation;
pub(crate) mod mixnet_contract_cache;
pub(crate) mod network;
mod network_monitor;
pub(crate) mod node_describe_cache;
mod node_performance;
pub(crate) mod node_status_api;
pub(crate) mod nym_nodes;
mod status;
pub(crate) mod support;
mod unstable_routes;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
cfg_if::cfg_if! {if #[cfg(feature = "console-subscriber")] {
// instrument tokio console subscriber needs RUSTFLAGS="--cfg tokio_unstable" at build time
console_subscriber::init();
}}
setup_tracing_logger();
info!("Starting nym api...");
let args = cli::Cli::parse();
trace!("args: {:#?}", args);
setup_env(args.config_env_file.as_ref());
args.execute().await
}