Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(ICRC_Ledger): FI-1666: Elaborate on ledger archiving options #5458

Merged
merged 2 commits into from
Feb 21, 2025
Merged
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
53 changes: 31 additions & 22 deletions docs/developer-docs/defi/tokens/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,6 @@ echo $(dfx identity get-principal)

Fee that users of the ledger will have to pay anytime they want to make a transfer.

#### `ARCHIVE_CONTROLLER`

The [controller <GlossaryTooltip>principal</GlossaryTooltip>](/docs/current/developer-docs/defi/cycles/cycles-wallet#controller-and-custodian-roles) of the archive canisters.

```
dfx identity new archive_controller
dfx identity use archive_controller
echo $(dfx identity get-principal)
```

#### `TRIGGER_THRESHOLD`

The number of blocks to archive when the trigger threshold is exceeded.

#### `CYCLE_FOR_ARCHIVE_CREATION`

The number of cycles that will be sent to the archive canister when it is created.

#### `NUM_OF_BLOCK_TO_ARCHIVE`

The number of blocks that will be archived.

#### `TOKEN_NAME`

The name of your token.
Expand All @@ -90,6 +68,37 @@ A flag for enabling or disabling certain extension standards to the ICRC-1 stand

If you only want to support the ICRC-1 standard, then you can set the flag to `false`. If you want to also support the ICRC-2 standard, set it to `true`.

### Archive options

The following options configure the archiving settings of the ledger.
In case optional fields are not specified, [the default values defined in `ArchiveOptions::new`](https://github.com/dfinity/ic/blob/396b461cd018448b075c82afac1b3a45b9a3dc1a/rs/ledger_suite/common/ledger_canister_core/src/archive.rs#L160-L176) are used.
For production deployments, it is recommended to set the values [similarly to what is done for SNS ledgers](https://github.com/dfinity/ic/blob/98fa250f488163fc5d94079c4acd81ba55761bd6/rs/sns/init/src/lib.rs#L600-L613).

#### `CONTROLLER_ID`

The [controller <GlossaryTooltip>principal</GlossaryTooltip>](/docs/current/developer-docs/defi/cycles/cycles-wallet#controller-and-custodian-roles) of the archive canisters.

```
dfx identity new archive_controller
dfx identity use archive_controller
echo $(dfx identity get-principal)
```

#### `TRIGGER_THRESHOLD`

The number of blocks to archive when the trigger threshold is exceeded.

#### `CYCLES_FOR_ARCHIVE_CREATION`

The number of cycles that will be sent to the archive canister when it is created.
Note that this needs to cover [the cost for canister creation](/docs/current/developer-docs/gas-cost#canister-creation), and the installation of the canister.
If the value is set too low, archiving is effectively disabled.

#### `NUM_BLOCKS_TO_ARCHIVE`

The number of blocks that will be archived.
If this is set to zero, archiving is effectively disabled.

## Edit the project's dfx.json file

Replace the existing content in the `dfx.json` with the following, updating the values of `TOKEN_SYMBOL`, `TOKEN_NAME`, `MINTER`, `TRANSFER_FEE`, `DEFAULT_ACCOUNT_ID`, `PRE_MINTED_TOKENS`, `NUM_OF_BLOCKS_TO_ARCHIVE`, `TRIGGER_THRESHOLD`, and `ARCHIVE_CONTROLLER` with the values obtained in the previous steps:
Expand Down