From b97c369d78c36e72090609ee60238ede58ddae94 Mon Sep 17 00:00:00 2001 From: Ciprian Potor Date: Mon, 28 Sep 2026 23:16:38 +0300 Subject: [PATCH] Use _ instead of @ in the default snapshot file name The @ in the default snapshot name is not handled well by some shells and scripts. Switch to -_.snap and update the docs. Closes #70 --- README.md | 2 +- cli/main.rs | 2 +- core/src/commands/create_snapshot.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 831a1c3b272..9b77c5ed117 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ try-runtime \ try-runtime --runtime existing create-snapshot --uri ws://localhost:9999 -- my-snapshot.snap 2022-12-13 10:28:17.516 INFO main remote-ext: since no at is provided, setting it to latest finalized head, 0xe7d0b614dfe89af65b33577aae46a6f958c974bf52f8a5e865a0f4faeb578d22 2022-12-13 10:28:17.516 INFO main remote-ext: since no prefix is filtered, the data for all pallets will be downloaded -2022-12-13 10:28:17.550 INFO main remote-ext: writing snapshot of 1611464 bytes to "node-268@latest.snap" +2022-12-13 10:28:17.550 INFO main remote-ext: writing snapshot of 1611464 bytes to "node-268_latest.snap" 2022-12-13 10:28:17.551 INFO main remote-ext: initialized state externalities with storage root 0x925e4e95de4c08474fb7f976c4472fa9b8a1091619cd7820a793bf796ee6d932 and state_version V1 ``` diff --git a/cli/main.rs b/cli/main.rs index 45ee153b8e7..bf674dcf50a 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -251,7 +251,7 @@ //! try-runtime --runtime existing create-snapshot --uri ws://localhost:9999 -- my-snapshot.snap //! 2022-12-13 10:28:17.516 INFO main remote-ext: since no at is provided, setting it to latest finalized head, 0xe7d0b614dfe89af65b33577aae46a6f958c974bf52f8a5e865a0f4faeb578d22 //! 2022-12-13 10:28:17.516 INFO main remote-ext: since no prefix is filtered, the data for all pallets will be downloaded -//! 2022-12-13 10:28:17.550 INFO main remote-ext: writing snapshot of 1611464 bytes to "node-268@latest.snap" +//! 2022-12-13 10:28:17.550 INFO main remote-ext: writing snapshot of 1611464 bytes to "node-268_latest.snap" //! 2022-12-13 10:28:17.551 INFO main remote-ext: initialized state externalities with storage root 0x925e4e95de4c08474fb7f976c4472fa9b8a1091619cd7820a793bf796ee6d932 and state_version V1 //! ``` //! diff --git a/core/src/commands/create_snapshot.rs b/core/src/commands/create_snapshot.rs index c4105a91bb5..e4b2b8a50ac 100644 --- a/core/src/commands/create_snapshot.rs +++ b/core/src/commands/create_snapshot.rs @@ -38,7 +38,8 @@ pub struct Command { /// The snapshot path to write to. /// - /// If not provided `-@.snap` will be used. + /// If not provided `-_.snap` will be used + /// (`latest` instead of the hash if no block is given). #[clap(index = 1)] pub snapshot_path: Option, } @@ -67,7 +68,7 @@ where .await .unwrap(); let path_str = format!( - "{}-{}@{}.snap", + "{}-{}_{}.snap", remote_spec.spec_name.to_lowercase(), remote_spec.spec_version, command.from.at.clone().unwrap_or("latest".to_owned())