Difference between revisions of "Topping up canisters"
From Internet Computer Wiki
m |
|||
(One intermediate revision by the same user not shown) | |||
Line 20: | Line 20: | ||
= Using NNS = | = Using NNS = | ||
− | To use ICP to top up a canister via [https://nns.ic0.app/ NNS], follow these steps: | + | To use ICP to top up a canister via [https://nns.ic0.app/ NNS frontend dapp], follow these steps: |
# Go to the "My canisters" tab | # Go to the "My canisters" tab | ||
# Add the canister to your list of canisters using the "Link canister" button | # Add the canister to your list of canisters using the "Link canister" button | ||
# Click on the newly linked canister | # Click on the newly linked canister | ||
− | # Use the "Add cycles" button | + | # Use the "Add cycles" button. This will work even when an error like "there was an error loading the details of the canister" shows up. |
Latest revision as of 12:08, 3 October 2023
Using dfx
There are two options to top up any canister: By depositing cycles, or by converting ICP to cycles directly.
Depositing cycles
If you have a cycles wallet configured, you can take any amount of cycles from it and deposit them directly into a canister. To do so, use
dfx canister --network ic deposit-cycles <canister id> <amount of cycles>
As an example, to send 10 trillion cycles (TC) to canister fg7gi-vyaaa-aaaal-qadca-cai
, you would run
dfx canister --network ic deposit-cycles fg7gi-vyaaa-aaaal-qadca-cai 10000000000000
Using ICP directly
If you have ICP that you want to use to top up any canister, you can run
dfx ledger --network ic top-up <canister id> --amount <amount of ICP to convert>
As an example, to top up canister fg7gi-vyaaa-aaaal-qadca-cai
with 10.3 ICP, you can run
dfx ledger --network ic top-up fg7gi-vyaaa-aaaal-qadca-cai --amount 10.3
Using NNS
To use ICP to top up a canister via NNS frontend dapp, follow these steps:
- Go to the "My canisters" tab
- Add the canister to your list of canisters using the "Link canister" button
- Click on the newly linked canister
- Use the "Add cycles" button. This will work even when an error like "there was an error loading the details of the canister" shows up.