Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
telezhnaya committed May 30, 2024
1 parent 9d3d3e2 commit f058a1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SIGNER_ID> <RECEIVER_ID>`.

Run the benchmarks until the program is manually halted: `cargo run -- run <SIGNER_ID>`.
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.
Expand All @@ -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`.
Logs are printed to `stdout`. Log level can be controlled through the environment variable `RUST_LOG`.
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit f058a1c

Please sign in to comment.