From 098e81242c80c4e2596e2d451bf54403334a10c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Bj=C3=B6rkqvist?= Date: Fri, 21 Feb 2025 09:46:29 +0200 Subject: [PATCH 1/2] Elaborate on ledger archiving options --- docs/developer-docs/defi/tokens/create.mdx | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/docs/developer-docs/defi/tokens/create.mdx b/docs/developer-docs/defi/tokens/create.mdx index 6d3838b2a2..66ab1e121b 100644 --- a/docs/developer-docs/defi/tokens/create.mdx +++ b/docs/developer-docs/defi/tokens/create.mdx @@ -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 principal](/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. @@ -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). + +#### `ARCHIVE_CONTROLLER` + +The [controller principal](/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. +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_OF_BLOCK_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: From c3ac1dfbf5a71222ea5cbc8b905a3d76a5f931a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Bj=C3=B6rkqvist?= Date: Fri, 21 Feb 2025 09:53:34 +0200 Subject: [PATCH 2/2] Fix variable names --- docs/developer-docs/defi/tokens/create.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developer-docs/defi/tokens/create.mdx b/docs/developer-docs/defi/tokens/create.mdx index 66ab1e121b..53db147008 100644 --- a/docs/developer-docs/defi/tokens/create.mdx +++ b/docs/developer-docs/defi/tokens/create.mdx @@ -74,7 +74,7 @@ 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). -#### `ARCHIVE_CONTROLLER` +#### `CONTROLLER_ID` The [controller principal](/docs/current/developer-docs/defi/cycles/cycles-wallet#controller-and-custodian-roles) of the archive canisters. @@ -88,13 +88,13 @@ echo $(dfx identity get-principal) The number of blocks to archive when the trigger threshold is exceeded. -#### `CYCLE_FOR_ARCHIVE_CREATION` +#### `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_OF_BLOCK_TO_ARCHIVE` +#### `NUM_BLOCKS_TO_ARCHIVE` The number of blocks that will be archived. If this is set to zero, archiving is effectively disabled.