1use std::net::IpAddr;
2
3use crate::{
4 consts::{DEFAULT_PEERING_PORT, DEFAULT_PORT},
5 ignition::cmd::IgnitionCmd,
6 local::cmd::LocalCmd,
7 testnet::cmd::TestnetCmd,
8};
9use clap::{Parser, Subcommand};
10
11#[derive(Debug, Parser)]
12#[clap(name = "forc node", version)]
13pub struct ForcNodeCmd {
16 #[arg(long)]
18 pub dry_run: bool,
19 #[command(subcommand)]
20 pub mode: Mode,
21}
22
23#[derive(Subcommand, Debug)]
24pub enum Mode {
25 Local(LocalCmd),
27 Testnet(TestnetCmd),
29 Ignition(IgnitionCmd),
31}
32
33#[derive(Parser, Debug, Clone)]
35pub struct ConnectionSettings {
36 #[clap(long)]
37 pub peer_id: Option<String>,
38 #[clap(long)]
39 pub secret: Option<String>,
40 #[clap(long)]
41 pub relayer: Option<String>,
42 #[clap(long, default_value = "0.0.0.0")]
43 pub ip: IpAddr,
44 #[clap(long, default_value_t = DEFAULT_PORT, value_parser = clap::value_parser!(u16).range(1..=65535))]
45 pub port: u16,
46 #[clap(long, default_value_t = DEFAULT_PEERING_PORT, value_parser = clap::value_parser!(u16).range(1..=65535))]
47 pub peering_port: u16,
48}