From f058a1c0c94fb710d71d7e27e1b624974b430692 Mon Sep 17 00:00:00 2001 From: telezhnaya Date: Thu, 30 May 2024 14:50:17 +0100 Subject: [PATCH] Update readme --- README.md | 18 +++++++----------- src/config.rs | 10 +++++----- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 432f8c6..2d8a54e 100644 --- a/README.md +++ b/README.md @@ -3,24 +3,20 @@ An application to measure the end user latency of transactions on the Near blockchain. ## Supported transactions -- Token transfer to another account -- Token transfer to self +- Token transfer with default parameters +- Token transfer with [`wait_until: IncludedFinal`](https://docs.near.org/api/rpc/transactions#tx-status-result) +- Token transfer with [`wait_until: Final`](https://docs.near.org/api/rpc/transactions#tx-status-result) +- Swap NEAR -> USDT +- FT USDT transfer ## Usage Run locally with `cargo` or build and run as a docker image: ``` docker build -t tx-bench . - docker run --rm -it tx-bench ``` -Check the program's help: `cargo run -- -h`. - -List the supported transactions: `cargo run -- list`. - -Run a single transaction once: `cargo run -- test token_transfer `. - -Run the benchmarks until the program is manually halted: `cargo run -- run `. +You can also run it without Docker, follow the usual Rust workflow. ## CI The CI checks that the project compiles successfully at every commit. Docker images are pushed to the registry only by tagged builds. @@ -29,4 +25,4 @@ The CI checks that the project compiles successfully at every commit. Docker ima Metrics are exposed by default on `0.0.0.0:9000`. ## Logs -Logs are printed to `stdout`. Log level can be controlled through the environment variable `RUST_LOG`. \ No newline at end of file +Logs are printed to `stdout`. Log level can be controlled through the environment variable `RUST_LOG`. diff --git a/src/config.rs b/src/config.rs index 890423d..b4155a0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -24,7 +24,7 @@ pub enum Mode { )] pub struct Opts { /// Mode - #[clap(short, long, env, value_enum, default_value = "list")] + #[clap(long, env, value_enum, default_value = "list")] pub mode: Mode, /// RPC URL #[clap(long, env)] @@ -38,13 +38,13 @@ pub struct Opts { /// Receiver account id #[clap(long, env)] pub receiver_id: AccountId, - /// wrap.near account id (different for testnet) + /// wrap.near account id (different for testnet), used for swap #[clap(long, env)] pub wrap_near_id: AccountId, - /// FT account id + /// FT account id, used for swap and FT transfer #[clap(long, env)] pub ft_account_id: AccountId, - /// Exchange account id + /// Exchange account id, used for swap #[clap(long, env)] pub exchange_id: AccountId, /// Pool id for swap command @@ -56,7 +56,7 @@ pub struct Opts { /// Number of times each transaction is performed at every benchmarking run #[clap(long, env, default_value_t = 1)] pub repeats_number: u32, - /// Time difference between two benchmarking runs. + /// Time difference between benchmarking runs #[clap(env, short, long, value_parser = humantime::parse_duration, default_value = "15m")] pub period: std::time::Duration, /// Metric server address.