Skip to content

Commit

Permalink
fix snapshot path
Browse files Browse the repository at this point in the history
  • Loading branch information
nonast committed Mar 4, 2023
1 parent dcbe647 commit ed5a998
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ol/cli/src/mgmt/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ impl Backup {

/// helper to get path to manifest file
pub fn manifest_path(&self) -> Result<PathBuf, Error> {
let glob_format = &format!("{}/**/epoch_ending.manifest", &self.restore_path.to_str().expect("no restore path provided"));
let glob_format = &format!("{}/**/state.manifest", &self.restore_path.to_str().expect("no restore path provided"));
let manifest_path = match glob(glob_format)
.expect("Failed to read glob pattern")
.next()
Expand All @@ -316,6 +316,7 @@ impl Backup {

/// To check if backup archive has already been fetched
pub fn archive_exists(&self) -> bool {
// check if
self.archive_path.exists()
}
}
Expand Down
7 changes: 5 additions & 2 deletions ol/genesis-tools/src/wizard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,13 @@ impl GenesisWizard {
// All we are doing is download the snapshot from github.
let backup = Backup::new(self.epoch, app_cfg);

if !backup.archive_exists() {
backup.fetch_backup(false)?;
if backup.manifest_path().is_err() {
backup.fetch_backup(true)?;
} else {
println!("Already have snapshot for epoch {}", self.epoch.unwrap());
}

// I changed the manifest file name to state.manifest instead of epoch_ending.manifest
let snapshot_manifest_file = backup.manifest_path()?;

let snapshot_dir = snapshot_manifest_file.parent().unwrap().to_path_buf();
Expand Down

0 comments on commit ed5a998

Please sign in to comment.