pub fn parse_cli_args() -> Result<Config, Box<dyn Error>>Expand description
Parses command-line arguments and environment variables into a Config.
The following environment variables are inspected:
JETSTREAMER_CLICKHOUSE_MODE: Controls ClickHouse integration. Acceptsauto,remote,local, oroff.JETSTREAMER_THREADS: Number of firehose ingestion threads.JETSTREAMER_SEQUENTIAL: Enables single-thread sequential firehose mode when truthy.JETSTREAMER_REVERSE: Enables reverse epoch iteration when truthy. Implies sequential mode.JETSTREAMER_BUFFER_WINDOW: Optional ripget sequential window size (for example4GiB).
CLI flags:
--with-plugin <name>: Adds one of the built-in plugins (program-tracking,instruction-tracking, orpubkey-stats). When omitted, the CLI defaults toprogram-tracking.--no-plugins: Disables all built-in plugins (overrides the default and any--with-plugin).--sequential: Enables single-thread sequential firehose mode.--reverse: Streams epochs from highest to lowest. Implies--sequential.--buffer-window <size>: Overrides ripget sequential window size (for example4GiB).
ยงExamples
let config = parse_cli_args().expect("env and CLI parsed");
assert_eq!(config.threads, 3);
assert!(!config.clickhouse_enabled);