Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/website/root/manual/develop/nodes/mithril-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 |
| ----------- | ------------------------------------------------------------------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mithril-client-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion mithril-client-cli/src/commands/cardano_db/shared_steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion mithril-client-cli/src/commands/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
35 changes: 1 addition & 34 deletions mithril-client-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
}
Expand Down Expand Up @@ -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([
Expand Down