790e7a0e1e
* POC measurement * parentce76790761author durch <durch@users.noreply.github.com> 1680116778 +0200 committer durch <durch@users.noreply.github.com> 1680683399 +0200 Instrument packet processing * Cleanup and format * Feature gate tracing * Add .gitkeep to wallet dist * Squashed commit of the following: commit0b1b6947e8Author: Jon Häggblad <jon.haggblad@gmail.com> Date: Wed Apr 5 11:28:28 2023 +0200 Replace mobile flag with target_os = android (#3278) * Remove old lock file * Start replacing mobile with android * Regex replace all mobile with android * Remove the mobile feature flag * keep the cfg mobile in tauri commitc79b2cfb78Author: Jon Häggblad <jon.haggblad@gmail.com> Date: Wed Apr 5 11:27:38 2023 +0200 Service provider directory contract (#3220) * first commit of service provider directory contract proof of concept * *added config set on instantiation, *removed greetQuery test function * commit before mapping change * *changed mapping of service to use client address instead of cosmos addr * commit before mapping change * added acl to delete() * added test for acl in delete() * changed whitelist<vec> to standrd_whitelist bool in Service struct * removed old comments and commented out code * rustfmt * wup * wup * Older version of cw-multi-test that works with 1.0.0 * wip * Remove .gitignore * Basic tests for announce and query now works * Restore tests for delete as well * Consolidate tests * Tidy * fmt * Start reworking test helpers * Tidy tests * More test work * More test improvements * More work on tests * Tweaks * Further tests * rustfmt * Add some comments * Initial work on requiring deposit * wip * Work on updating tests for handling funds * Start updating integration tests * Integration tests updated * merge test mods in state * Address review comments * Enable wasm-opt * Unify Result type * consistent amount in error type * WIP: paging output * IndexedMap working * extract to config file * WIP: middle of extracting out types * Extract types * wip * Types now extracted out: * Paged response type too * rustfmt * Start working on switching to cw Admin * Complete switch to Admin * Remove owner from announce msg * remove unused imports * Assert owner * Extract out types to common crate * Fix test compilation * Add query by owner and nym address * Move msg to common crate * rustfmt * tests for service id * service storage tests * state services tests * function rename * tidy * Fix clippy warning * User ServiceId instead and not u32 * Delete by nym address * Emit explicit events * Swap ToString for Display * Move all storage keys to constants.rs * clippy * Test for deleting by name * Tidy integration tests * Remove to_string * Some comments to tests * Integration test for paging * serde snake_csae for NymAddress and ServiceType * Add migrate entry point * Add query contract version * A few more asserts for balance * Make MigrateMsg a struct --------- Co-authored-by: mx <maxhampshire@pm.me> commitdd699bce9aMerge:5ce017ef3e6957e7a9Author: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com> Date: Wed Apr 5 10:18:16 2023 +0100 Merge pull request #3235 from nymtech/feature/performance-active-set-selection Feature/performance active set selection commit5ce017ef3dAuthor: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed Apr 5 10:57:45 2023 +0200 adding vesting tests (#3279) commit59c1ce2639Merge:4fb63d889276edfd56Author: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com> Date: Wed Apr 5 09:50:53 2023 +0100 Merge pull request #3261 from nymtech/feature/refresh-allow-list Feature/refresh allow list commit4fb63d8892Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Wed Apr 5 09:22:43 2023 +0100 Feature/vesting delegation amount query (#3229) * moved queries and transactions out of contract.rs * added queries for vesting delegation details * nyxd_client support commit276edfd562Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 15:56:21 2023 +0100 clippy commit605f8fcde3Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 15:06:12 2023 +0100 updated and cleaned up tests commitf0e4d1a7cfAuthor: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 14:01:36 2023 +0100 configurable stored lists locations commit055ec4bdd5Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 12:57:02 2023 +0100 updating stored allow list on file changes commit5761f9ac7fAuthor: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 12:15:45 2023 +0100 file watcher commit32620fd55fAuthor: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Thu Mar 30 17:47:12 2023 +0100 updating standard list in a timer commitabb5cdbe06Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Thu Mar 30 16:43:58 2023 +0100 extracted domain and ipnet information to separate struct commite6957e7a99Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Tue Mar 28 11:25:43 2023 +0100 use combination of stake and performance for rewarded set selection commitde2406a2c7Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Tue Mar 28 10:54:14 2023 +0100 Moved MixnodeWithPerformance to helpers * Squashed commit of the following: commit0b1b6947e8Author: Jon Häggblad <jon.haggblad@gmail.com> Date: Wed Apr 5 11:28:28 2023 +0200 Replace mobile flag with target_os = android (#3278) * Remove old lock file * Start replacing mobile with android * Regex replace all mobile with android * Remove the mobile feature flag * keep the cfg mobile in tauri commitc79b2cfb78Author: Jon Häggblad <jon.haggblad@gmail.com> Date: Wed Apr 5 11:27:38 2023 +0200 Service provider directory contract (#3220) * first commit of service provider directory contract proof of concept * *added config set on instantiation, *removed greetQuery test function * commit before mapping change * *changed mapping of service to use client address instead of cosmos addr * commit before mapping change * added acl to delete() * added test for acl in delete() * changed whitelist<vec> to standrd_whitelist bool in Service struct * removed old comments and commented out code * rustfmt * wup * wup * Older version of cw-multi-test that works with 1.0.0 * wip * Remove .gitignore * Basic tests for announce and query now works * Restore tests for delete as well * Consolidate tests * Tidy * fmt * Start reworking test helpers * Tidy tests * More test work * More test improvements * More work on tests * Tweaks * Further tests * rustfmt * Add some comments * Initial work on requiring deposit * wip * Work on updating tests for handling funds * Start updating integration tests * Integration tests updated * merge test mods in state * Address review comments * Enable wasm-opt * Unify Result type * consistent amount in error type * WIP: paging output * IndexedMap working * extract to config file * WIP: middle of extracting out types * Extract types * wip * Types now extracted out: * Paged response type too * rustfmt * Start working on switching to cw Admin * Complete switch to Admin * Remove owner from announce msg * remove unused imports * Assert owner * Extract out types to common crate * Fix test compilation * Add query by owner and nym address * Move msg to common crate * rustfmt * tests for service id * service storage tests * state services tests * function rename * tidy * Fix clippy warning * User ServiceId instead and not u32 * Delete by nym address * Emit explicit events * Swap ToString for Display * Move all storage keys to constants.rs * clippy * Test for deleting by name * Tidy integration tests * Remove to_string * Some comments to tests * Integration test for paging * serde snake_csae for NymAddress and ServiceType * Add migrate entry point * Add query contract version * A few more asserts for balance * Make MigrateMsg a struct --------- Co-authored-by: mx <maxhampshire@pm.me> commitdd699bce9aMerge:5ce017ef3e6957e7a9Author: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com> Date: Wed Apr 5 10:18:16 2023 +0100 Merge pull request #3235 from nymtech/feature/performance-active-set-selection Feature/performance active set selection commit5ce017ef3dAuthor: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed Apr 5 10:57:45 2023 +0200 adding vesting tests (#3279) commit59c1ce2639Merge:4fb63d889276edfd56Author: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com> Date: Wed Apr 5 09:50:53 2023 +0100 Merge pull request #3261 from nymtech/feature/refresh-allow-list Feature/refresh allow list commit4fb63d8892Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Wed Apr 5 09:22:43 2023 +0100 Feature/vesting delegation amount query (#3229) * moved queries and transactions out of contract.rs * added queries for vesting delegation details * nyxd_client support commit276edfd562Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 15:56:21 2023 +0100 clippy commit605f8fcde3Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 15:06:12 2023 +0100 updated and cleaned up tests commitf0e4d1a7cfAuthor: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 14:01:36 2023 +0100 configurable stored lists locations commit055ec4bdd5Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 12:57:02 2023 +0100 updating stored allow list on file changes commit5761f9ac7fAuthor: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Fri Mar 31 12:15:45 2023 +0100 file watcher commit32620fd55fAuthor: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Thu Mar 30 17:47:12 2023 +0100 updating standard list in a timer commitabb5cdbe06Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Thu Mar 30 16:43:58 2023 +0100 extracted domain and ipnet information to separate struct commite6957e7a99Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Tue Mar 28 11:25:43 2023 +0100 use combination of stake and performance for rewarded set selection commitde2406a2c7Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Date: Tue Mar 28 10:54:14 2023 +0100 Moved MixnodeWithPerformance to helpers
82 lines
2.0 KiB
Rust
82 lines
2.0 KiB
Rust
// Copyright 2020-2023 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
#[macro_use]
|
|
extern crate rocket;
|
|
|
|
use ::nym_config::defaults::setup_env;
|
|
use clap::{crate_name, crate_version, Parser};
|
|
use lazy_static::lazy_static;
|
|
#[cfg(feature = "cpucycles")]
|
|
use mixnode_common::measure;
|
|
use nym_bin_common::build_information::BinaryBuildInformation;
|
|
#[allow(unused_imports)]
|
|
use nym_bin_common::logging::{maybe_print_banner, setup_logging};
|
|
#[cfg(feature = "cpucycles")]
|
|
use nym_bin_common::setup_tracing;
|
|
#[cfg(feature = "cpucycles")]
|
|
use tracing::instrument;
|
|
mod commands;
|
|
mod config;
|
|
mod node;
|
|
|
|
lazy_static! {
|
|
pub static ref PRETTY_BUILD_INFORMATION: String =
|
|
BinaryBuildInformation::new(env!("CARGO_PKG_VERSION")).pretty_print();
|
|
}
|
|
|
|
// Helper for passing LONG_VERSION to clap
|
|
fn pretty_build_info_static() -> &'static str {
|
|
&PRETTY_BUILD_INFORMATION
|
|
}
|
|
|
|
#[derive(Parser)]
|
|
#[clap(author = "Nymtech", version, about, long_version = pretty_build_info_static())]
|
|
struct Cli {
|
|
/// Path pointing to an env file that configures the mixnode.
|
|
#[clap(short, long)]
|
|
pub(crate) config_env_file: Option<std::path::PathBuf>,
|
|
|
|
#[clap(subcommand)]
|
|
command: commands::Commands,
|
|
}
|
|
|
|
#[cfg(feature = "cpucycles")]
|
|
#[instrument(fields(cpucycles))]
|
|
fn test_function() {
|
|
measure!({})
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
cfg_if::cfg_if! {
|
|
if #[cfg(feature = "cpucycles")] {
|
|
setup_tracing!("/tmp/tracing.log");
|
|
} else {
|
|
setup_logging();
|
|
}
|
|
}
|
|
|
|
maybe_print_banner(crate_name!(), crate_version!());
|
|
|
|
let args = Cli::parse();
|
|
setup_env(args.config_env_file.as_ref());
|
|
commands::execute(args).await;
|
|
|
|
cfg_if::cfg_if! {
|
|
if #[cfg(feature = "cpucycles")] {
|
|
opentelemetry::global::shutdown_tracer_provider();
|
|
}}
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
use clap::CommandFactory;
|
|
|
|
#[test]
|
|
fn verify_cli() {
|
|
Cli::command().debug_assert();
|
|
}
|
|
}
|