Difference between revisions of "Topping up canisters"

From Internet Computer Wiki
Jump to: navigation, search
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

Revision as of 10:28, 1 February 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:

  1. Go to the "My canisters" tab
  2. Add the canister to your list of canisters using the "Link canister" button
  3. Click on the newly linked canister
  4. Use the "Add cycles" button