Skip to content

Commit

Permalink
Pass new incremental path
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell committed Jan 21, 2025
1 parent f9a1d12 commit c09090d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tip-router-operator-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ pub struct Cli {
#[arg(short, long, env)]
pub full_snapshots_path: Option<PathBuf>,

#[arg(short, long, env)]
pub backup_snapshots_dir: PathBuf,

#[arg(short, long, env)]
pub snapshot_output_dir: PathBuf,

Expand All @@ -49,9 +52,6 @@ pub enum Commands {
#[arg(long, env)]
tip_router_program_id: Pubkey,

#[arg(long, env)]
backup_snapshots_dir: PathBuf,

#[arg(long, env, default_value = "false")]
enable_snapshots: bool,

Expand Down
4 changes: 3 additions & 1 deletion tip-router-operator-cli/src/ledger_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub fn get_bank_from_ledger(
ledger_path: &Path,
account_paths: Vec<PathBuf>,
full_snapshots_path: PathBuf,
incremental_snapshots_path: PathBuf,
desired_slot: &Slot,
take_snapshot: bool,
) -> Arc<Bank> {
Expand Down Expand Up @@ -162,7 +163,7 @@ pub fn get_bank_from_ledger(

let snapshot_config = SnapshotConfig {
full_snapshot_archives_dir: full_snapshots_path.clone(),
incremental_snapshot_archives_dir: full_snapshots_path.clone(),
incremental_snapshot_archives_dir: incremental_snapshots_path.clone(),
bank_snapshots_dir: full_snapshots_path,
..SnapshotConfig::new_load_only()
};
Expand Down Expand Up @@ -317,6 +318,7 @@ mod tests {
&ledger_path,
account_paths,
full_snapshots_path.clone(),
full_snapshots_path.clone(),
&desired_slot,
true,
);
Expand Down
2 changes: 2 additions & 0 deletions tip-router-operator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub fn get_meta_merkle_root(
ledger_path: &Path,
account_paths: Vec<PathBuf>,
full_snapshots_path: PathBuf,
incremental_snapshots_path: PathBuf,
desired_slot: &Slot,
tip_distribution_program_id: &Pubkey,
out_path: &str,
Expand Down Expand Up @@ -103,6 +104,7 @@ pub fn get_meta_merkle_root(
ledger_path,
account_paths,
full_snapshots_path,
incremental_snapshots_path,
desired_slot,
tip_distribution_program_id,
out_path,
Expand Down
3 changes: 1 addition & 2 deletions tip-router-operator-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ async fn main() -> Result<()> {
tip_distribution_program_id,
tip_payment_program_id,
tip_router_program_id,
ref backup_snapshots_dir,
enable_snapshots,
num_monitored_epochs,
start_next_epoch,
Expand All @@ -71,7 +70,7 @@ async fn main() -> Result<()> {

let rpc_client_clone = rpc_client.clone();
let full_snapshots_path = cli.full_snapshots_path.clone().unwrap();
let backup_snapshots_dir = backup_snapshots_dir.clone();
let backup_snapshots_dir = cli.backup_snapshots_dir.clone();
let rpc_url = cli.rpc_url.clone();
let cli_clone = cli.clone();

Expand Down
2 changes: 2 additions & 0 deletions tip-router-operator-cli/src/process_epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub async fn process_epoch(
let ledger_path = cli_args.ledger_path.clone();
let account_paths = cli_args.account_paths.clone();
let full_snapshots_path = cli_args.full_snapshots_path.clone();
let incremental_snapshots_path = cli_args.backup_snapshots_dir.clone();
let operator_address = Pubkey::from_str(&cli_args.operator_address).unwrap();
let meta_merkle_tree_dir = cli_args.meta_merkle_tree_dir.clone();

Expand All @@ -81,6 +82,7 @@ pub async fn process_epoch(
cli_args.ledger_path.as_path(),
account_paths,
full_snapshots_path,
incremental_snapshots_path,
&target_slot,
tip_distribution_program_id,
"", // TODO out_path is not used, unsure what should be put here. Maybe `snapshot_output_dir` from cli args?
Expand Down
2 changes: 2 additions & 0 deletions tip-router-operator-cli/src/stake_meta_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ pub fn generate_stake_meta(
ledger_path: &Path,
account_paths: Vec<PathBuf>,
full_snapshots_path: PathBuf,
incremental_snapshots_path: PathBuf,
desired_slot: &Slot,
tip_distribution_program_id: &Pubkey,
_out_path: &str,
Expand All @@ -89,6 +90,7 @@ pub fn generate_stake_meta(
ledger_path,
account_paths,
full_snapshots_path,
incremental_snapshots_path,
desired_slot,
snapshots_enabled,
);
Expand Down

0 comments on commit c09090d

Please sign in to comment.