Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-restart flag #65

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
}