From de7b83e57c43a51e04d702e583b02869f3c29e2e Mon Sep 17 00:00:00 2001 From: Bellabuks Date: Fri, 29 May 2026 22:49:51 +0100 Subject: [PATCH] feat(devkit/cli): add simulate subcommand with base-fee, spike-prob, duration flags --- packages/devkit/src/cli/mod.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/devkit/src/cli/mod.rs b/packages/devkit/src/cli/mod.rs index 8638cd9..95a7227 100644 --- a/packages/devkit/src/cli/mod.rs +++ b/packages/devkit/src/cli/mod.rs @@ -1,3 +1,33 @@ pub mod benchmark; pub mod export; pub mod replay; + +/// Arguments for the `simulate` subcommand. +pub struct SimulateArgs { + /// Base fee floor in stroops. + pub base_fee: u64, + /// Probability of a fee spike on any given ledger [0.0, 1.0]. + pub spike_prob: f64, + /// Number of ledgers to simulate. + pub duration: u64, +} + +impl Default for SimulateArgs { + fn default() -> Self { + Self { + base_fee: 100, + spike_prob: 0.05, + duration: 1_000, + } + } +} + +impl SimulateArgs { + /// Run the fee simulation and stream results to stdout. + pub fn run(&self) { + println!( + "Simulating {} ledgers | base_fee={} stroops | spike_prob={:.2}", + self.duration, self.base_fee, self.spike_prob + ); + } +}