diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index c178d9c5e6c..63085633866 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -174,7 +174,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash working-directory: ./bin - run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} --unstable tools utxo-hd snapshot-converter --db-directory v1/db --cardano-node-version latest --utxo-hd-flavor LMDB --commit + run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} tools utxo-hd snapshot-converter --db-directory v1/db --cardano-node-version latest --utxo-hd-flavor LMDB --commit - name: Remove downloaded artifacts to free up disk space (Linux, Windows) if: runner.os != 'macOS' @@ -335,7 +335,7 @@ jobs: - name: Ledger state snapshot conversion from InMemory to LMDB if: matrix.extra_args == '--include-ancillary' shell: bash - run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} --unstable tools utxo-hd snapshot-converter --db-directory /app/data/v1/db --cardano-node-version latest --utxo-hd-flavor LMDB --commit + run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} tools utxo-hd snapshot-converter --db-directory /app/data/v1/db --cardano-node-version latest --utxo-hd-flavor LMDB --commit - name: Remove downloaded artifacts to free up disk space shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc58b8a529..2b1a6fe5b99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,11 +21,13 @@ As a minor extension, we have adopted a slightly different versioning convention - Support for stable `v2` backend of `cardano-db` command and decommission of the `cardano-db-v2` command in client CLI. +- Support for stable `tools utxo-hd` commands in client CLI. + - Add a new `/certificate/genesis` route to the aggregator that fetches the latest genesis certificate - Abstracted the implementation of KES signature and verification to allow multiple and reusable implementations. -- Upgrade the Rust edition of the repository from 2021 to 2024 +- Upgrade the Rust edition of the repository from `2021` to `2024`. - Add pre-built Linux ARM binaries in the distribution for the signer, client CLI, and aggregator. diff --git a/Cargo.lock b/Cargo.lock index 749c1795400..2940605f5a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4210,7 +4210,7 @@ dependencies = [ [[package]] name = "mithril-client-cli" -version = "0.12.29" +version = "0.12.30" dependencies = [ "anyhow", "async-trait", diff --git a/docs/website/root/manual/develop/nodes/mithril-client.md b/docs/website/root/manual/develop/nodes/mithril-client.md index 9ee51d14d2b..7cf0fc48d0b 100644 --- a/docs/website/root/manual/develop/nodes/mithril-client.md +++ b/docs/website/root/manual/develop/nodes/mithril-client.md @@ -222,7 +222,7 @@ Commands: mithril-stake-distribution Mithril stake distribution management (alias: msd) cardano-transaction Cardano transactions management (alias: ctx) cardano-stake-distribution Cardano stake distribution management (alias: csd) - tools [unstable] Tools commands + tools Tools commands help Print this message or the help of the given subcommand(s) Options: @@ -519,7 +519,7 @@ Here are the subcommands available: | **help** | Prints this message or the help for the given subcommand(s) | | **list** | Lists available Cardano stake distributions | -### Tools (`unstable`) +### Tools | Subcommand | Performed action | | ----------- | ------------------------------------------------------------------------------------- | diff --git a/docs/website/root/manual/getting-started/bootstrap-cardano-node.md b/docs/website/root/manual/getting-started/bootstrap-cardano-node.md index d8a4a3d0ac1..55c221075bb 100644 --- a/docs/website/root/manual/getting-started/bootstrap-cardano-node.md +++ b/docs/website/root/manual/getting-started/bootstrap-cardano-node.md @@ -486,27 +486,27 @@ Cardano db 'a1b5e6f43521fd9c5f55e3d6bf27dc4a62f43980681cb67e28cc40582a0d1974' ha Upgrade and replace the restored ledger state snapshot to 'LMDB' flavor by running the command: - mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor LMDB --commit + mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor LMDB --commit Or to 'Legacy' flavor by running the command: - mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor Legacy --commit + mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor Legacy --commit ``` ### Step 5 (optional): Convert the ledger state snapshot to another flavor After restoring a snapshot with the `--include-ancillary` option, the ledger state is in the `InMemory` format. You can convert it to another UTxO-HD flavor (e.g., `LMDB` or `Legacy`) using the Mithril client `tools utxo-hd snapshot-converter` command. -To do so, run the following command with the `--unstable` flag: +To do so, run the following command: ``` -mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor LMDB +mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor LMDB ``` Or, to convert it to the `Legacy` flavor: ``` -mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor Legacy +mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor Legacy ``` Use the `--commit` option to replace the current ledger state with the converted snapshot. diff --git a/mithril-client-cli/Cargo.toml b/mithril-client-cli/Cargo.toml index 2ea37448740..034cd6419b5 100644 --- a/mithril-client-cli/Cargo.toml +++ b/mithril-client-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-client-cli" -version = "0.12.29" +version = "0.12.30" description = "A Mithril Client" authors = { workspace = true } edition = { workspace = true } diff --git a/mithril-client-cli/src/commands/cardano_db/shared_steps.rs b/mithril-client-cli/src/commands/cardano_db/shared_steps.rs index 07928241b45..f80b3fbfa2f 100644 --- a/mithril-client-cli/src/commands/cardano_db/shared_steps.rs +++ b/mithril-client-cli/src/commands/cardano_db/shared_steps.rs @@ -172,7 +172,7 @@ pub fn log_download_information( let snapshot_converter_cmd = |flavor| { format!( - "mithril-client --unstable tools utxo-hd snapshot-converter --db-directory {} --cardano-node-version {} --utxo-hd-flavor {} --commit", + "mithril-client tools utxo-hd snapshot-converter --db-directory {} --cardano-node-version {} --utxo-hd-flavor {} --commit", db_dir.display(), cardano_node_version, flavor, diff --git a/mithril-client-cli/src/commands/tools/mod.rs b/mithril-client-cli/src/commands/tools/mod.rs index 1c151f29881..65fefa1d54e 100644 --- a/mithril-client-cli/src/commands/tools/mod.rs +++ b/mithril-client-cli/src/commands/tools/mod.rs @@ -13,7 +13,7 @@ use mithril_client::MithrilResult; /// Tools commands #[derive(Subcommand, Debug, Clone)] -#[command(about = "[unstable] Tools commands")] +#[command(about = "Tools commands")] pub enum ToolsCommands { /// UTxO-HD related commands #[clap(subcommand, name = "utxo-hd")] diff --git a/mithril-client-cli/src/main.rs b/mithril-client-cli/src/main.rs index 69f5fa73c52..3d201acfc97 100644 --- a/mithril-client-cli/src/main.rs +++ b/mithril-client-cli/src/main.rs @@ -250,10 +250,7 @@ impl ArtifactCommands { Self::GenerateDoc(cmd) => { cmd.execute(&mut Args::command()).map_err(|message| anyhow!(message)) } - Self::Tools(cmd) => { - context.require_unstable("tools", Some("utxo-hd snapshot-converter"))?; - cmd.execute().await - } + Self::Tools(cmd) => cmd.execute().await, } } } @@ -281,36 +278,6 @@ async fn main() -> MithrilResult<()> { mod tests { use super::*; - #[tokio::test] - async fn fail_if_tools_command_is_used_without_unstable_flag() { - let args = Args::try_parse_from([ - "mithril-client", - "tools", - "utxo-hd", - "snapshot-converter", - "--db-directory", - "whatever", - "--cardano-network", - "preview", - "--cardano-node-version", - "1.2.3", - "--utxo-hd-flavor", - "Legacy", - ]) - .unwrap(); - - let error = args - .execute(Logger::root(slog::Discard, slog::o!())) - .await - .expect_err("Should fail if unstable flag missing"); - - assert!( - error - .to_string() - .contains("subcommand is only accepted using the --unstable flag.") - ); - } - #[tokio::test] async fn verify_subcommand_should_fail_with_cardano_db_v1() { let args = Args::try_parse_from([