kabu_exex/
arguments.rs

1use clap::{Parser, Subcommand};
2
3/// Triggers persistence when the number of canonical blocks in memory exceeds this threshold.
4pub const DEFAULT_PERSISTENCE_THRESHOLD: u64 = 2;
5
6/// How close to the canonical head we persist blocks.
7pub const DEFAULT_MEMORY_BLOCK_BUFFER_TARGET: u64 = 2;
8
9#[derive(Debug, Subcommand)]
10pub enum Command {
11    Node(KabuArgsNode),
12    Remote(KabuArgs),
13}
14
15#[derive(Parser, Debug)]
16#[command(name="Kabu", version, about, long_about = None)]
17pub struct AppArgs {
18    #[command(subcommand)]
19    pub command: Command,
20}
21
22#[derive(Parser, Debug)]
23pub struct KabuArgsNode {}
24
25#[derive(Parser, Debug)]
26pub struct KabuArgs {
27    #[arg(long, default_value = "config.toml")]
28    pub kabu_config: String,
29
30    // Original RETH CLI arguments
31    /// Configure persistence threshold for engine experimental.
32    #[arg(long = "engine.persistence-threshold", default_value_t = DEFAULT_PERSISTENCE_THRESHOLD)]
33    pub persistence_threshold: u64,
34
35    /// Configure the target number of blocks to keep in memory.
36    #[arg(long = "engine.memory-block-buffer-target", default_value_t = DEFAULT_MEMORY_BLOCK_BUFFER_TARGET)]
37    pub memory_block_buffer_target: u64,
38}