-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Image>, | ||
/// Command to run the node | ||
pub command: Option<Command>, | ||
/// Arguments to pass to the node | ||
pub args: Vec<Arg>, | ||
/// Env vars to set | ||
pub env: Vec<EnvVar>, | ||
/// 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<Port>, | ||
/// Prometheus port to use, if None a random one will be set | ||
pub prometheus_port: Option<Port>, | ||
/// P2P port to use, if None a random one will be set | ||
pub p2p_port: Option<Port>, | ||
$( | ||
pub $field: $type, | ||
)* | ||
} | ||
}; | ||
} | ||
|
||
pub(crate) use create_add_options; |