From 9873f9045bdf7d46a9b21a39c5451a2f140a0318 Mon Sep 17 00:00:00 2001 From: Jessie Mongeon <133128541+jessiemongeon1@users.noreply.github.com> Date: Sun, 17 Nov 2024 22:42:35 -0500 Subject: [PATCH] Update topping-up-canister.mdx --- .../topping-up/topping-up-canister.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/developer-docs/smart-contracts/topping-up/topping-up-canister.mdx b/docs/developer-docs/smart-contracts/topping-up/topping-up-canister.mdx index bd0c3e79b0..bb2f56208d 100644 --- a/docs/developer-docs/smart-contracts/topping-up/topping-up-canister.mdx +++ b/docs/developer-docs/smart-contracts/topping-up/topping-up-canister.mdx @@ -67,7 +67,7 @@ Balance: 9_811_813_913_485 Cycles Module hash: 0xe7866e1949e3688a78d8d29bd63e1c13cd6bfb8fbe29444fa606a20e0b1e33f0 ``` -Canisters can check their own balance programmatically. For example: +Canisters can check their balance programmatically. For example: @@ -100,7 +100,7 @@ let current_canister_balance = ic_cdk::api::canister_balance(); ### Option 1: If you have ICP on your account -If you have ICP on the account associated with a `dfx` identity, you can tell the ledger canister to take some of that ICP, convert it to cycles, and give it to a canister of your choice using the command `dfx ledger top-up --icp --network ic`: +If you have ICP on the account associated with a `dfx` identity, you can convert ICP into cycles, then top up a canister with those cycles: ```bash dfx ledger account-id @@ -115,7 +115,7 @@ dfx ledger top-up --icp 1 jqylk-byaaa-aaaal-qbymq-cai --network ic ### Option 2: If you have cycles -If you have a cycles balance associated with your developer identity, you can top up a canister with the command `dfx cycles top-up `: +If you already have cycles, you can top up a canister with the command `dfx cycles top-up `: ```bash dfx cycles balance --network ic @@ -150,7 +150,7 @@ dfx wallet balance --network ic dfx wallet send 1T dfds-sddds-aaaal-qbsms-cai --network ic ``` --   The `wallet balance --network ic ` checks the cycles balance of your cycles wallet on the mainnet. +-   The `wallet balance --network ic` checks the cycles balance of your cycles wallet on the mainnet. -   The `wallet send 1T dfds-sddds-aaaal-qbsms-cai --network ic` takes one trillion cycles from your cycles wallet and sends them to cycles wallet `dfds-sddds-aaaal-qbsms-cai`. ## Topping up a canister with the NNS frontend dapp @@ -159,7 +159,7 @@ You can also top up any canister via the [NNS frontend dapp](https://nns.ic0.app - #### Step 1: Navigate to the **My Canisters** section of the dapp. - #### Step 2: Click **Link Canister**. -- #### Step 3: Add a canister principal. It is not necessary for the user to actually control said canister. +- #### Step 3: Add a canister principal. The user doesn't need to control the canister. - #### Step 4: Once the canister is added, click on that canister. - #### Step 5: Click `Add cycles` to add cycles using the ICP in your NNS frontend dapp. @@ -167,17 +167,17 @@ You can also top up any canister via the [NNS frontend dapp](https://nns.ic0.app ICP features a mechanism to prevent canisters from running out of cycles. Canisters have a configurable `freezing_threshold`, dynamically evaluated in cycles. -In the output of the `dfx canister status` command, you may have noticed the `freezing threshold` value. The freezing threshold is a value defined in seconds, which is used to calculate how many cycles a canister must retain in its cycles balance. This calculation is based off of the canister's memory consumption. The default freezing threshold value is `2_592_000s`, which corresponds to 30 days. +In the output of the `dfx canister status` command, you may have noticed the `freezing threshold` value. The freezing threshold is a value defined in seconds, which is used to calculate how many cycles a canister must retain in its cycles balance. This calculation is based on the canister's memory consumption. The default freezing threshold value is `2_592_000s`, which corresponds to 30 days. -The freezing threshold is important because if a canister runs out of cycles, it will be uninstalled. The freezing threshold protects it from deletion, since if the cycles balance dips below the threshold, the canister will stop processing any new requests; however, it will continue to reply to existing requests. +The freezing threshold is important because if a canister runs out of cycles, it will be uninstalled. The freezing threshold protects it from deletion since if the cycles balance dips below the threshold, the canister will stop processing any new requests; however, it will continue to reply to existing requests. For example, to set a freezing threshold for your `poll_backend` canister, use the command: -``````bash +``` dfx canister update-settings poll_backend --freezing-threshold 3472000 ``` -Then, you can confirm that this threshold has been set by running the `dfx canister status poll_backend --network ic ` command again: +Then, confirm that this threshold has been set by running the `dfx canister status poll_backend --network ic ` command again: ```bash Canister status call result for poll_backend.