Skip to content

Commit 163d6d6

Browse files
committed
feat(client-cli): display guidance message for UTxO-HD snapshot conversion after restoration with --include-ancillary
1 parent f6a42d6 commit 163d6d6

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ impl PreparedCardanoDbDownload {
185185
&db_dir,
186186
&cardano_db_message,
187187
self.is_json_output_enabled(),
188+
self.include_ancillary,
188189
)?;
189190

190191
Ok(())
@@ -328,6 +329,7 @@ impl PreparedCardanoDbDownload {
328329
db_dir: &Path,
329330
cardano_db: &Snapshot,
330331
json_output: bool,
332+
include_ancillary: bool,
331333
) -> MithrilResult<()> {
332334
let canonicalized_filepath = &db_dir.canonicalize().with_context(|| {
333335
format!(
@@ -361,6 +363,19 @@ impl PreparedCardanoDbDownload {
361363
);
362364
}
363365

366+
if include_ancillary {
367+
println!(
368+
r###""Upgrade and replace the restored ledger state snapshot to LMDB flavor by running the command:
369+
370+
mithril-client --unstable tools utxo-hd snapshot-converter --db-directory {} --cardano-node-version {} --utxo-hd-flavor LMDB --cardano-network {} --commit
371+
372+
"###,
373+
db_dir.display(),
374+
cardano_db.cardano_node_version,
375+
cardano_db.network
376+
);
377+
}
378+
364379
Ok(())
365380
}
366381
}

mithril-client-cli/src/commands/cardano_db_v2/download.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ impl PreparedCardanoDbV2Download {
245245
&restoration_options.db_dir,
246246
&cardano_db_message,
247247
self.is_json_output_enabled(),
248+
restoration_options
249+
.download_unpack_options
250+
.include_ancillary,
248251
)?;
249252

250253
Ok(())
@@ -488,6 +491,7 @@ impl PreparedCardanoDbV2Download {
488491
db_dir: &Path,
489492
cardano_db_snapshot: &CardanoDatabaseSnapshot,
490493
json_output: bool,
494+
include_ancillary: bool,
491495
) -> MithrilResult<()> {
492496
let canonicalized_filepath = &db_dir.canonicalize().with_context(|| {
493497
format!(
@@ -521,6 +525,19 @@ impl PreparedCardanoDbV2Download {
521525
);
522526
}
523527

528+
if include_ancillary {
529+
println!(
530+
r###""Upgrade and replace the restored ledger state snapshot to LMDB flavor by running the command:
531+
532+
mithril-client --unstable tools utxo-hd snapshot-converter --db-directory {} --cardano-node-version {} --utxo-hd-flavor LMDB --cardano-network {} --commit
533+
534+
"###,
535+
db_dir.display(),
536+
cardano_db_snapshot.cardano_node_version,
537+
cardano_db_snapshot.network
538+
);
539+
}
540+
524541
Ok(())
525542
}
526543
}

0 commit comments

Comments
 (0)