Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions packages/devkit/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@ 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
);
}
/// Arguments for the `mock` subcommand.
pub struct MockArgs {
/// Scenario to load (e.g. "normal", "congested", "spike").
Expand Down
Loading