zombienet_orchestrator/shared/
macros.rs

1macro_rules! create_add_options {
2    ($struct:ident {$( $field:ident:$type:ty ),*}) =>{
3        #[derive(Default, Debug, Clone)]
4        pub struct $struct {
5            /// Image to run the node
6            pub image: Option<Image>,
7            /// Command to run the node
8            pub command: Option<Command>,
9            /// Subcommand for the node
10            pub subcommand: Option<Command>,
11            /// Arguments to pass to the node
12            pub args: Vec<Arg>,
13            /// Env vars to set
14            pub env: Vec<EnvVar>,
15            /// Make the node a validator
16            ///
17            /// This implies `--validator` or `--collator`
18            pub is_validator: bool,
19            /// RPC port to use, if None a random one will be set
20            pub rpc_port: Option<Port>,
21            /// Prometheus port to use, if None a random one will be set
22            pub prometheus_port: Option<Port>,
23            /// P2P port to use, if None a random one will be set
24            pub p2p_port: Option<Port>,
25            $(
26                pub $field: $type,
27            )*
28        }
29    };
30}
31
32pub(crate) use create_add_options;