# Getting the init archive settings of a ledger canister

**URL:** <https://forum.dfinity.org/t/getting-the-init-archive-settings-of-a-ledger-canister/41390>\
**Category:** Developers\
**Tags:** rust\
**Created:** [February 19, 2025, 3:37pm UTC](https://forum.dfinity.org/t/getting-the-init-archive-settings-of-a-ledger-canister/41390 "2025-02-19T15:37:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mathiasb](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@mathiasb](https://forum.dfinity.org/u/mathiasb)\
**Post date:** [February 21, 2025, 11:24am UTC](https://forum.dfinity.org/t/getting-the-init-archive-settings-of-a-ledger-canister/41390/4 "2025-02-21T11:24:56Z")

</div>

> What happens if not values for the archive options are set on the launch of a ledger.

The archive options can be changed by specifying the [ChangeArchiveOptions](https://github.com/dfinity/ic/blob/7fac242b3043137a5c170c96d8a13e9338aa63b6/rs/ledger_suite/icrc1/ledger/src/lib.rs#L284-L294) field in the [UpgradeArgs](https://github.com/dfinity/ic/blob/7fac242b3043137a5c170c96d8a13e9338aa63b6/rs/ledger_suite/icrc1/ledger/src/lib.rs#L325-L343) in a ledger upgrade.

> What are the default settings?

I expanded a bit on the archive options in [the documentation](https://internetcomputer.org/docs/current/developer-docs/defi/tokens/create#archive-options). In particular, I linked to [the default settings](https://github.com/dfinity/ic/blob/396b461cd018448b075c82afac1b3a45b9a3dc1a/rs/ledger_suite/common/ledger_canister_core/src/archive.rs#L160-L176), and also [some more useful recommended settings](https://github.com/dfinity/ic/blob/98fa250f488163fc5d94079c4acd81ba55761bd6/rs/sns/init/src/lib.rs#L600-L613) that are used, e.g., for SNS ledgers. The ck-token ledger and SNS ledgers should all have some reasonable values set. For independently-deployed ICRC ledgers based on the DFINITY Rust implementation, what you could do to check the archiving is the following:

- Query the `archives()` endpoint of the ledger ([this](https://dashboard.internetcomputer.org/canister/mxzaz-hqaaa-aaaar-qaada-cai#archives) is for the ckBTC ledger - replace the canister ID with that of your ledger)
  - If one or more archives exists, then archiving is configured correctly (if there are _loads_ of archives, then perhaps `node_max_memory_size_bytes` is too small, but I haven’t seen cases of that in the wild).
  - If no archives exists, check the number of blocks in the ledger by querying the [`get_blocks` endpoint](https://dashboard.internetcomputer.org/canister/mxzaz-hqaaa-aaaar-qaada-cai#get_blocks), with `start = 0` and `length = 1`. If there are lots of blocks in the ledger (`chain_length` is e.g., more than `2_000`), then there may be an issue with the archive options.

The lowest-risk way to set the archiving options would be to upgrade the ledger to same WASM it is currently running, and only setting the `ChangeArchiveOptions` in the `UpgradeArgs`. For more info on how to upgrade your ledger, and if you don’t know what WASM your ledger is currently running, refer to the instructions in [the ICRC Ledger Suite Upgrade forum post](https://forum.dfinity.org/t/icrc-ledger-suite-upgrade/40655).

---

_[View the full topic](https://forum.dfinity.org/t/getting-the-init-archive-settings-of-a-ledger-canister/41390)._
