diff --git a/crates/orchestrator/src/shared/macros.rs b/crates/orchestrator/src/shared/macros.rs new file mode 100644 index 000000000..f79b3a1aa --- /dev/null +++ b/crates/orchestrator/src/shared/macros.rs @@ -0,0 +1,30 @@ +macro_rules! create_add_options { + ($struct:ident {$( $field:ident:$type:ty ),*}) =>{ + #[derive(Default, Debug, Clone)] + pub struct $struct { + /// Image to run the node + pub image: Option, + /// Command to run the node + pub command: Option, + /// Arguments to pass to the node + pub args: Vec, + /// Env vars to set + pub env: Vec, + /// Make the node a validator + /// + /// This implies `--validator` or `--collator` + pub is_validator: bool, + /// RPC port to use, if None a random one will be set + pub rpc_port: Option, + /// Prometheus port to use, if None a random one will be set + pub prometheus_port: Option, + /// P2P port to use, if None a random one will be set + pub p2p_port: Option, + $( + pub $field: $type, + )* + } + }; +} + +pub(crate) use create_add_options;