Skip to content

Commit

Permalink
Merge pull request #65 from CriesofCarrots/no-restart
Browse files Browse the repository at this point in the history
Add --no-restart flag
  • Loading branch information
CriesofCarrots authored Aug 6, 2024
2 parents 6ff57aa + 962c93f commit 2c1566b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ impl<'a> Kubernetes<'a> {
if self.validator_config.require_tower {
flags.push("--require-tower".to_string());
}
if !self.validator_config.restart {
flags.push("--no-restart".to_string());
}

if let Some(limit_ledger_size) = self.validator_config.max_ledger_size {
flags.push("--limit-ledger-size".to_string());
Expand Down
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ fn parse_matches() -> clap::ArgMatches {
.default_value("100")
.help("The commission taken by nodes on staking rewards (0-100)")
)
.arg(
Arg::with_name("no_restart")
.long("no-restart")
.help("Validator config. If set, validators will not restart after \
exiting for any reason."),
)
//RPC config
.arg(
Arg::with_name("number_of_rpc_nodes")
Expand Down Expand Up @@ -535,6 +541,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
require_tower: matches.is_present("require_tower"),
enable_full_rpc: matches.is_present("enable_full_rpc"),
known_validators: vec![],
restart: !matches.is_present("no_restart"),
};

if num_rpc_nodes == 0 && !validator_config.enable_full_rpc {
Expand Down
1 change: 1 addition & 0 deletions src/validator_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ pub struct ValidatorConfig {
pub require_tower: bool,
pub enable_full_rpc: bool,
pub known_validators: Vec<Pubkey>,
pub restart: bool,
}

0 comments on commit 2c1566b

Please sign in to comment.