reth_node_core/args/
benchmark_args.rs1use clap::Args;
4use std::path::PathBuf;
5
6#[derive(Debug, Args, PartialEq, Eq, Default, Clone)]
8#[command(next_help_heading = "Benchmark")]
9pub struct BenchmarkArgs {
10 #[arg(long, verbatim_doc_comment)]
12 pub from: Option<u64>,
13
14 #[arg(long, verbatim_doc_comment)]
16 pub to: Option<u64>,
17
18 #[arg(long, conflicts_with_all = &["from", "to"], verbatim_doc_comment)]
22 pub advance: Option<u64>,
23
24 #[arg(
31 long = "jwt-secret",
32 alias = "jwtsecret",
33 value_name = "PATH",
34 global = true,
35 required = false
36 )]
37 pub auth_jwtsecret: Option<PathBuf>,
38
39 #[arg(
41 long,
42 value_name = "ENGINE_RPC_URL",
43 verbatim_doc_comment,
44 default_value = "http://localhost:8551"
45 )]
46 pub engine_rpc_url: String,
47
48 #[arg(long, short, value_name = "BENCHMARK_OUTPUT", verbatim_doc_comment)]
50 pub output: Option<PathBuf>,
51}
52
53#[cfg(test)]
54mod tests {
55 use super::*;
56 use clap::Parser;
57
58 #[derive(Parser)]
60 struct CommandParser<T: Args> {
61 #[command(flatten)]
62 args: T,
63 }
64
65 #[test]
66 fn test_parse_benchmark_args() {
67 let default_args = BenchmarkArgs {
68 engine_rpc_url: "http://localhost:8551".to_string(),
69 ..Default::default()
70 };
71 let args = CommandParser::<BenchmarkArgs>::parse_from(["reth-bench"]).args;
72 assert_eq!(args, default_args);
73 }
74}