From 2da896fa40d4f5ad2dd3d42fd34569a29d6d966e Mon Sep 17 00:00:00 2001 From: Kirill Lykov Date: Tue, 15 Mar 2022 16:48:26 +0000 Subject: [PATCH] add documentation --- dos/Cargo.toml | 1 + dos/src/main.rs | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/dos/Cargo.toml b/dos/Cargo.toml index 8810ec7831..4d3fddc09d 100644 --- a/dos/Cargo.toml +++ b/dos/Cargo.toml @@ -7,6 +7,7 @@ repository = "https://github.com/solana-labs/solana" license = "Apache-2.0" homepage = "https://solana.com/" publish = false +description = "Tool to send various requests to cluster in order to evaluate the effect on performance" [dependencies] bincode = "1.3.3" diff --git a/dos/src/main.rs b/dos/src/main.rs index ac08fdadbe..11168597d5 100644 --- a/dos/src/main.rs +++ b/dos/src/main.rs @@ -1,3 +1,30 @@ +//! DoS tool +//! +//! Sends requests to cluster in a loop to measure +//! the effect of ihandling these requests on the performance of the cluster. +//! +//! * `mode` argument defines interface to use (e.g. rpc, tvu, tpu) +//! * `data-type` argument specifies the type of the request. +//! It takes various values, some of them makes sense with particular `mode` value (e.g. `get-account-info` is valid only with `mode=rpc`). +//! +//! Most of the options are provided for `data-type = transaction`. +//! These options allow to compose transaction whcih fails at +//! a particular stage of the processing pipeline. +//! +//! Example 1: send random transactions to TPU +//! ```bash +//! solana-dos --entrypoint 127.0.0.1:8001 --mode tpu --data-type random +//! ``` +//! +//! Example 2: send unique transactions with valid hashblock to TPU +//! ```bash +//! solana-dos --entrypoint 127.0.0.1:8001 --mode tpu --data-type random +//! solana-dos --entrypoint 127.0.0.1:8001 --mode tpu \ +//! --data-type transaction --generate-unique-transactions +//! --payer config/bootstrap-validator/identity.json \ +//! --generate-valid-blockhash +//! ``` +//! #![allow(clippy::integer_arithmetic)] use { clap::{crate_description, crate_name, crate_version, ArgEnum, Args, Parser},