From 491930adbb47e6244f56957001bb1f61a22e260d Mon Sep 17 00:00:00 2001 From: Josh Jones Date: Tue, 20 Jun 2023 14:03:46 -0500 Subject: [PATCH 1/3] restore `--tipset` flag --- src/cli/cli/snapshot_cmd.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cli/cli/snapshot_cmd.rs b/src/cli/cli/snapshot_cmd.rs index 7241f35b49d0..773c1e3a1847 100644 --- a/src/cli/cli/snapshot_cmd.rs +++ b/src/cli/cli/snapshot_cmd.rs @@ -37,6 +37,9 @@ pub enum SnapshotCommands { /// Don't write the archive. #[arg(long)] dry_run: bool, + /// Tipset to start the export from, default is the chain head + #[arg(short, long)] + tipset: Option, }, /// Fetches the most recent snapshot from a trusted, pre-defined location. @@ -68,13 +71,14 @@ impl SnapshotCommands { output_path, skip_checksum, dry_run, + tipset, } => { let chain_head = match chain_head(&config.client.rpc_token).await { Ok(head) => head.0, Err(_) => cli_error_and_die("Could not get network head", 1), }; - let epoch = chain_head.epoch(); + let epoch = tipset.unwrap_or(chain_head.epoch()); let chain_name = chain_get_name((), &config.client.rpc_token) .await @@ -85,7 +89,7 @@ impl SnapshotCommands { TrustedVendor::Forest, chain_name, Utc::now().date_naive(), - chain_head.epoch(), + epoch, )), false => output_path.clone(), }; From 4014d76a6cf519575719a4b2eba3c9fad432c6fb Mon Sep 17 00:00:00 2001 From: Josh Jones Date: Tue, 11 Jul 2023 15:26:21 -0300 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba801e3a4bc..d4264ce7a48e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ - [#3126](https://github.com/ChainSafe/forest/issues/3126): Bail on database lookup errors instead of silently ignoring them. +- [#2999](https://github.com/ChainSafe/forest/issues/2999): Restored `--tipset` + flag to `forest-cli snapshot export` to allow export at a specific tipset. ### Removed From 46afd3ec86d84bc041061db97bd0267f5a564849 Mon Sep 17 00:00:00 2001 From: Josh Jones Date: Thu, 13 Jul 2023 16:39:05 -0300 Subject: [PATCH 3/3] add newline after export --- src/cli/subcommands/snapshot_cmd.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli/subcommands/snapshot_cmd.rs b/src/cli/subcommands/snapshot_cmd.rs index 09270e294f23..2133cdbe83cc 100644 --- a/src/cli/subcommands/snapshot_cmd.rs +++ b/src/cli/subcommands/snapshot_cmd.rs @@ -132,6 +132,7 @@ impl SnapshotCommands { "Export completed. Snapshot located at {}", out.display() )); + println!("\n"); Ok(()) } Self::Fetch { directory, vendor } => {