Difference between revisions of "Topping up canisters"

From Internet Computer Wiki
Jump to: navigation, search
(Created page with "= 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 walle...")
 
Line 17: Line 17:
 
As an example, to top up canister <code>fg7gi-vyaaa-aaaal-qadca-cai</code> with 10.3 ICP, you can run
 
As an example, to top up canister <code>fg7gi-vyaaa-aaaal-qadca-cai</code> with 10.3 ICP, you can run
 
     dfx ledger --network ic top-up fg7gi-vyaaa-aaaal-qadca-cai --amount 10.3
 
     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 [https://nns.ic0.app/ NNS], 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

Revision as of 10:26, 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, 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