Add option for separate snapshot location

(cherry picked from commit 6126878f509c69e23480a5ec22b3271e2b16e072)
This commit is contained in:
DimAn
2021-03-13 21:48:26 +00:00
committed by Michael Vines
parent 58b980f9cd
commit 0209d334bd
3 changed files with 30 additions and 14 deletions

View File

@@ -178,11 +178,11 @@ pub fn download_genesis_if_missing(
pub fn download_snapshot(
rpc_addr: &SocketAddr,
ledger_path: &Path,
snapshot_output_dir: &Path,
desired_snapshot_hash: (Slot, Hash),
use_progress_bar: bool,
) -> Result<(), String> {
snapshot_utils::purge_old_snapshot_archives(ledger_path);
snapshot_utils::purge_old_snapshot_archives(snapshot_output_dir);
for compression in &[
ArchiveFormat::TarZstd,
@@ -190,7 +190,7 @@ pub fn download_snapshot(
ArchiveFormat::TarBzip2,
] {
let desired_snapshot_package = snapshot_utils::get_snapshot_archive_path(
ledger_path.to_path_buf(),
snapshot_output_dir.to_path_buf(),
&desired_snapshot_hash,
*compression,
);