Skip to content

Commit 959918d

Browse files
authored
Merge pull request #2681 from input-output-hk/jpraynaud/2625-stable-utxo-hd-tools-client
feat: stable `tools utxo-hd` commands in client CLI
2 parents d1a7dd2 + 1120444 commit 959918d

File tree

9 files changed

+17
-48
lines changed

9 files changed

+17
-48
lines changed

.github/workflows/test-client.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175175
shell: bash
176176
working-directory: ./bin
177-
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
177+
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
178178

179179
- name: Remove downloaded artifacts to free up disk space (Linux, Windows)
180180
if: runner.os != 'macOS'
@@ -335,7 +335,7 @@ jobs:
335335
- name: Ledger state snapshot conversion from InMemory to LMDB
336336
if: matrix.extra_args == '--include-ancillary'
337337
shell: bash
338-
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
338+
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
339339

340340
- name: Remove downloaded artifacts to free up disk space
341341
shell: bash

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ As a minor extension, we have adopted a slightly different versioning convention
2121

2222
- Support for stable `v2` backend of `cardano-db` command and decommission of the `cardano-db-v2` command in client CLI.
2323

24+
- Support for stable `tools utxo-hd` commands in client CLI.
25+
2426
- Add a new `/certificate/genesis` route to the aggregator that fetches the latest genesis certificate
2527

2628
- Abstracted the implementation of KES signature and verification to allow multiple and reusable implementations.
2729

28-
- Upgrade the Rust edition of the repository from 2021 to 2024
30+
- Upgrade the Rust edition of the repository from `2021` to `2024`.
2931

3032
- Add pre-built Linux ARM binaries in the distribution for the signer, client CLI, and aggregator.
3133

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/website/root/manual/develop/nodes/mithril-client.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Commands:
222222
mithril-stake-distribution Mithril stake distribution management (alias: msd)
223223
cardano-transaction Cardano transactions management (alias: ctx)
224224
cardano-stake-distribution Cardano stake distribution management (alias: csd)
225-
tools [unstable] Tools commands
225+
tools Tools commands
226226
help Print this message or the help of the given subcommand(s)
227227

228228
Options:
@@ -519,7 +519,7 @@ Here are the subcommands available:
519519
| **help** | Prints this message or the help for the given subcommand(s) |
520520
| **list** | Lists available Cardano stake distributions |
521521

522-
### Tools (`unstable`)
522+
### Tools
523523

524524
| Subcommand | Performed action |
525525
| ----------- | ------------------------------------------------------------------------------------- |

docs/website/root/manual/getting-started/bootstrap-cardano-node.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,27 +486,27 @@ Cardano db 'a1b5e6f43521fd9c5f55e3d6bf27dc4a62f43980681cb67e28cc40582a0d1974' ha
486486
487487
Upgrade and replace the restored ledger state snapshot to 'LMDB' flavor by running the command:
488488
489-
mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor LMDB --commit
489+
mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor LMDB --commit
490490
491491
Or to 'Legacy' flavor by running the command:
492492
493-
mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor Legacy --commit
493+
mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version 10.5.1 --utxo-hd-flavor Legacy --commit
494494
```
495495
496496
### Step 5 (optional): Convert the ledger state snapshot to another flavor
497497
498498
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.
499499
500-
To do so, run the following command with the `--unstable` flag:
500+
To do so, run the following command:
501501
502502
```
503-
mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor LMDB
503+
mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor LMDB
504504
```
505505
506506
Or, to convert it to the `Legacy` flavor:
507507
508508
```
509-
mithril-client --unstable tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor Legacy
509+
mithril-client tools utxo-hd snapshot-converter --db-directory db --cardano-node-version latest --utxo-hd-flavor Legacy
510510
```
511511
512512
Use the `--commit` option to replace the current ledger state with the converted snapshot.

mithril-client-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-client-cli"
3-
version = "0.12.29"
3+
version = "0.12.30"
44
description = "A Mithril Client"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-client-cli/src/commands/cardano_db/shared_steps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub fn log_download_information(
172172

173173
let snapshot_converter_cmd = |flavor| {
174174
format!(
175-
"mithril-client --unstable tools utxo-hd snapshot-converter --db-directory {} --cardano-node-version {} --utxo-hd-flavor {} --commit",
175+
"mithril-client tools utxo-hd snapshot-converter --db-directory {} --cardano-node-version {} --utxo-hd-flavor {} --commit",
176176
db_dir.display(),
177177
cardano_node_version,
178178
flavor,

mithril-client-cli/src/commands/tools/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use mithril_client::MithrilResult;
1313

1414
/// Tools commands
1515
#[derive(Subcommand, Debug, Clone)]
16-
#[command(about = "[unstable] Tools commands")]
16+
#[command(about = "Tools commands")]
1717
pub enum ToolsCommands {
1818
/// UTxO-HD related commands
1919
#[clap(subcommand, name = "utxo-hd")]

mithril-client-cli/src/main.rs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,7 @@ impl ArtifactCommands {
250250
Self::GenerateDoc(cmd) => {
251251
cmd.execute(&mut Args::command()).map_err(|message| anyhow!(message))
252252
}
253-
Self::Tools(cmd) => {
254-
context.require_unstable("tools", Some("utxo-hd snapshot-converter"))?;
255-
cmd.execute().await
256-
}
253+
Self::Tools(cmd) => cmd.execute().await,
257254
}
258255
}
259256
}
@@ -281,36 +278,6 @@ async fn main() -> MithrilResult<()> {
281278
mod tests {
282279
use super::*;
283280

284-
#[tokio::test]
285-
async fn fail_if_tools_command_is_used_without_unstable_flag() {
286-
let args = Args::try_parse_from([
287-
"mithril-client",
288-
"tools",
289-
"utxo-hd",
290-
"snapshot-converter",
291-
"--db-directory",
292-
"whatever",
293-
"--cardano-network",
294-
"preview",
295-
"--cardano-node-version",
296-
"1.2.3",
297-
"--utxo-hd-flavor",
298-
"Legacy",
299-
])
300-
.unwrap();
301-
302-
let error = args
303-
.execute(Logger::root(slog::Discard, slog::o!()))
304-
.await
305-
.expect_err("Should fail if unstable flag missing");
306-
307-
assert!(
308-
error
309-
.to_string()
310-
.contains("subcommand is only accepted using the --unstable flag.")
311-
);
312-
}
313-
314281
#[tokio::test]
315282
async fn verify_subcommand_should_fail_with_cardano_db_v1() {
316283
let args = Args::try_parse_from([

0 commit comments

Comments
 (0)