Topping up canisters

From Internet Computer Wiki
Revision as of 10:17, 1 February 2023 by Severin.siffert (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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