Skip to content

Commit

Permalink
Merge pull request #3638 from dfinity/cycles-wallet-ledger
Browse files Browse the repository at this point in the history
update/revise: Cycles wallet & Cycles ledger docs
  • Loading branch information
jessiemongeon1 authored Oct 23, 2024
2 parents 767949f + 9503cfc commit abe8af5
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 156 deletions.
19 changes: 19 additions & 0 deletions docs/developer-docs/defi/cycles/cycles-ledger.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,22 @@ Most functions of the cycle ledger incur a fee. The full breakdown of fees can b
- To transfer cycles between different principal IDs using the cycles ledger, the transfer fee is 100M cycles per transaction.
- To send cycles from the cycles ledger to another canister, the fee is 100M cycles.
- To create a canister, the fee is the transfer fee (100M cycles), plus the canister creation fee, which scales [linearly with the size of the subnet](/docs/current/developer-docs/gas-cost) that the canister is created on. For example, if the canister is created on a 13-node subnet, the fee is 100B cycles. This means the total fee will be 100_100_000_000 cycles.

## Switching from the cycles wallet to cycles ledger

To help transition from the commands and workflows you may be accustomed to using with the cycles wallet, the table below provides a translation from cycles wallet to cycles ledger commands.

:::info
All commands shown below are for workflows involving mainnet development. For local development, omit the `--network ic` flag.
:::

| Function | Cycles wallet command | Cycles ledger command |
|-----------------------|-----------------------|-----------------------|
| Checking the cycles balance | `dfx wallet balance --network ic` | `dfx cycles balance --network ic` |
| Converting ICP tokens into cycles | `dfx ledger create-canister PRINCIPAL_ID --amount AMOUNT --network ic` | `dfx cycles convert --amount AMOUNT --network ic` |
| Transferring cycles | `dfx wallet send PRINCIPAL_ID AMOUNT --network ic` | `dfx cycles transfer AMOUNT PRINCIPAL_ID (--subaccount [SUBACCOUNT]) --network ic` |
| Redeeming a cycles coupon | `dfx wallet redeem-faucet-coupon 'ABCDE-ABCDE-ABCDE'` | `dfx cycles redeem-faucet-coupon ABCDE-ABCDE-ABCDE --network ic` |
| Topping up a canister | `dfx wallet send PRINCIPAL_ID AMOUNT --network ic` | `dfx cycles top-up CANISTER_ID AMOUNT --network ic` |
| Creating a canister with cycles | `dfx canister call CYCLES_WALLET_CANISTER_ID wallet_create_canister '(record { cycles = 5000000000000 : nat64; controller = principal "PRINCIPAL_ID"})' --network ic` | `dfx canister create CANISTER_NAME --network ic` |


Loading

0 comments on commit abe8af5

Please sign in to comment.