Add CLI args for no-incremental-snapshot-fetch (#20787)
This commit is contained in:
@ -40,6 +40,12 @@ use {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
|
||||||
|
pub enum ConfigState {
|
||||||
|
Disabled,
|
||||||
|
Enabled,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RpcBootstrapConfig {
|
pub struct RpcBootstrapConfig {
|
||||||
pub no_genesis_fetch: bool,
|
pub no_genesis_fetch: bool,
|
||||||
@ -47,6 +53,8 @@ pub struct RpcBootstrapConfig {
|
|||||||
pub no_untrusted_rpc: bool,
|
pub no_untrusted_rpc: bool,
|
||||||
pub max_genesis_archive_unpacked_size: u64,
|
pub max_genesis_archive_unpacked_size: u64,
|
||||||
pub no_check_vote_account: bool,
|
pub no_check_vote_account: bool,
|
||||||
|
pub incremental_snapshots: ConfigState,
|
||||||
|
pub incremental_snapshot_fetch: ConfigState,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
|
@ -521,6 +521,13 @@ pub fn main() {
|
|||||||
.help("Do not attempt to fetch a snapshot from the cluster, \
|
.help("Do not attempt to fetch a snapshot from the cluster, \
|
||||||
start from a local snapshot if present"),
|
start from a local snapshot if present"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("no_incremental_snapshot_fetch")
|
||||||
|
.long("no-incremental-snapshot-fetch")
|
||||||
|
.takes_value(false)
|
||||||
|
.help("Do not attempt to fetch incremental snapshots from the cluster, only fetch \
|
||||||
|
full snapshots"),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("no_genesis_fetch")
|
Arg::with_name("no_genesis_fetch")
|
||||||
.long("no-genesis-fetch")
|
.long("no-genesis-fetch")
|
||||||
@ -1788,6 +1795,16 @@ pub fn main() {
|
|||||||
"max_genesis_archive_unpacked_size",
|
"max_genesis_archive_unpacked_size",
|
||||||
u64
|
u64
|
||||||
),
|
),
|
||||||
|
incremental_snapshots: if matches.is_present("incremental_snapshots") {
|
||||||
|
bootstrap::ConfigState::Enabled
|
||||||
|
} else {
|
||||||
|
bootstrap::ConfigState::Disabled
|
||||||
|
},
|
||||||
|
incremental_snapshot_fetch: if matches.is_present("no_incremental_snapshot_fetch") {
|
||||||
|
bootstrap::ConfigState::Disabled
|
||||||
|
} else {
|
||||||
|
bootstrap::ConfigState::Enabled
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let private_rpc = matches.is_present("private_rpc");
|
let private_rpc = matches.is_present("private_rpc");
|
||||||
|
Reference in New Issue
Block a user