Skip to content

Commit 7c83b82

Browse files
committed
max 20 vals
1 parent 60f47f0 commit 7c83b82

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cli/src/cmd/testnet/start.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type PrivateKey<C> = <<C as Context>::SigningScheme as SigningScheme>::PrivateKe
1818

1919
#[derive(Parser, Debug, Clone, PartialEq)]
2020
pub struct TestnetStartCmd {
21-
/// Number of node pairs to create
21+
/// Number of node pairs to create (max 20)
2222
#[clap(short, long, default_value = "3")]
2323
pub nodes: usize,
2424

@@ -35,6 +35,11 @@ impl TestnetStartCmd {
3535
N: Node + CanGeneratePrivateKey + CanMakeGenesis + CanMakePrivateKeyFile,
3636
PrivateKey<N::Context>: serde::de::DeserializeOwned,
3737
{
38+
// Validate node count
39+
if self.nodes == 0 || self.nodes > 20 {
40+
return Err(eyre!("Number of nodes must be between 1 and 20 (got {})", self.nodes));
41+
}
42+
3843
println!("🚀 Initializing testnet with {} nodes...\n", self.nodes);
3944

4045
// 1. Check if custom-reth is available

0 commit comments

Comments
 (0)