diff --git a/docs/developer-docs/smart-contracts/overview/introduction.mdx b/docs/developer-docs/smart-contracts/overview/introduction.mdx index 724264107c..09f42fdae2 100644 --- a/docs/developer-docs/smart-contracts/overview/introduction.mdx +++ b/docs/developer-docs/smart-contracts/overview/introduction.mdx @@ -6,7 +6,7 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip"; -# Introduction +# What are canisters? diff --git a/docs/tutorials/developer-journey/level-0/01-ic-overview.mdx b/docs/tutorials/developer-journey/level-0/01-ic-overview.mdx index 2fbfaf8116..5070d018d8 100644 --- a/docs/tutorials/developer-journey/level-0/01-ic-overview.mdx +++ b/docs/tutorials/developer-journey/level-0/01-ic-overview.mdx @@ -7,7 +7,7 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip"; -# 0.1 Overview of the Internet Computer +# 0.1 What is the Internet Computer? @@ -17,8 +17,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - The **Internet Computer Protocol (ICP)** is a secure and transparent blockchain-based network that can be used to host data and programs. Programs and their data hosted on ICP are referred to as **decentralized applications**, often abbreviated to **dapps**. Dapps are created by the development and deployment of **smart contracts**, which are known as **canisters** on ICP. Each canister is hosted on an independent blockchain network running on **nodes** called a **subnet**. diff --git a/docs/tutorials/developer-journey/level-0/02-ic-terms.mdx b/docs/tutorials/developer-journey/level-0/02-ic-terms.mdx index f417d1deaf..f62b320a0a 100644 --- a/docs/tutorials/developer-journey/level-0/02-ic-terms.mdx +++ b/docs/tutorials/developer-journey/level-0/02-ic-terms.mdx @@ -15,8 +15,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - This page introduces some of the most commonly used terminology that developers should be aware of when building on the Internet Computer. This page covers many terms, but does not include every single term that is related to the Internet Computer. [View the full glossary of terms](/docs/current/references/glossary). ## Concepts diff --git a/docs/tutorials/developer-journey/level-0/03-dev-env.mdx b/docs/tutorials/developer-journey/level-0/03-dev-env.mdx index af0b434226..7ec875c733 100644 --- a/docs/tutorials/developer-journey/level-0/03-dev-env.mdx +++ b/docs/tutorials/developer-journey/level-0/03-dev-env.mdx @@ -15,8 +15,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - Before you can begin the developer ladder, you need to set up a developer environment. A developer environment consists of tools and packages that are required to develop code projects. Usually, developer environments are stored and hosted on your local computer, but there are some situations where a virtual, web-based development environment exists. An example of this is the [playground](https://m7sm4-2iaaa-aaaab-qabra-cai.ic0.app/), which is a web-based, virtual developer environment that can be used by developers without having to set up a local environment. Deploying to the playground is ICP's equivalent of deploying to a testnet network. diff --git a/docs/tutorials/developer-journey/level-0/04-intro-canisters.mdx b/docs/tutorials/developer-journey/level-0/04-intro-canisters.mdx index fa4e0d0eee..07694e200a 100644 --- a/docs/tutorials/developer-journey/level-0/04-intro-canisters.mdx +++ b/docs/tutorials/developer-journey/level-0/04-intro-canisters.mdx @@ -15,8 +15,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - Smart contracts on the Internet Computer are known as **canisters**. A canister contains both the source code and software state. A canister's source code is compiled into a WebAssembly module and is associated with a module of stable memory. When a dapp is written to be deployed on ICP, the source code is compiled into a WebAssembly module. Then, that WebAssembly module is deployed and executed inside of the canister. Once a canister is deployed, end-users can interact with the canister through the CLI or through a frontend client such as a web browser. diff --git a/docs/tutorials/developer-journey/level-0/05-intro-languages.mdx b/docs/tutorials/developer-journey/level-0/05-intro-languages.mdx index a04a9cc819..9806368a46 100644 --- a/docs/tutorials/developer-journey/level-0/05-intro-languages.mdx +++ b/docs/tutorials/developer-journey/level-0/05-intro-languages.mdx @@ -15,8 +15,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - When developing canisters, the most common development workflow is to use a software development kit (SDK). The Internet Computer SDK is the most commonly used, which natively supports Motoko and Rust out of the box. Since ICP supports dapps that have been compiled into WebAssembly modules, many different programming languages can be used for canister development. However, a canister development kit (CDK) needs to be used. A CDK is an adapter used by the IC SDK that provides a programming language with the necessary features and tools required to create and manage canisters. The IC SDK comes bundled with CDKs for Motoko and Rust. Additionally, there are several community created CDKs for additional languages, such as Python and TypeScript, that can be installed separately. diff --git a/docs/tutorials/developer-journey/level-0/06-intro-dfx.mdx b/docs/tutorials/developer-journey/level-0/06-intro-dfx.mdx index 210fae6a31..2435c63310 100644 --- a/docs/tutorials/developer-journey/level-0/06-intro-dfx.mdx +++ b/docs/tutorials/developer-journey/level-0/06-intro-dfx.mdx @@ -15,8 +15,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - `dfx` is a command line utility that is used to interact with the IC SDK. It is the primary tool that is used for creating, managing, and deploying dapps onto the Internet Computer. The `dfx` parent command has several flags and subcommands that can be used to perform a wide array of operations. First, you'll take a look at basic usage of the command, then you'll get started creating your first project using dfx. diff --git a/docs/tutorials/developer-journey/level-0/index.mdx b/docs/tutorials/developer-journey/level-0/index.mdx index 5558da83f2..ed54033e84 100644 --- a/docs/tutorials/developer-journey/level-0/index.mdx +++ b/docs/tutorials/developer-journey/level-0/index.mdx @@ -8,23 +8,23 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; -- [0.1 Overview of the Internet Computer](/docs/current/tutorials/developer-journey/level-0/ic-overview): In order to understand how to develop dapps on ICP, the first step in the developer ladder is to take a look at the architecture of ICP and how it functions. This module covers: - - Overview of The Internet Computer Protocol: +- [0.1 What is the Internet Computer?](/docs/current/tutorials/developer-journey/level-0/ic-overview): In order to understand how to develop dapps on ICP, the first step in the developer ladder is to take a look at the architecture of ICP and how it functions. This module covers: + - What is the Internet Computer?: - Protocol stack: - Peer-to peer layer. - Consensus layer. - Message routing layer. - Execution layer. - - Overview of chain-key cryptography: + - Chain-key cryptography: - Threshold signature schemes. - - Overview of canisters and smart contracts. - - Overview of tokens: + - Canister smart contracts. + - Tokens: - ICP. - Cycles. - - Overview of governance: + - Governance: - Network Nervous System. - Service Nervous System. - - Overview of Internet Identity. + - Internet Identity. - [0.2 Internet Computer terminology](/docs/current/tutorials/developer-journey/level-0/ic-terms): This page introduces some of the most commonly used terminology that developers should be aware of when building on the Internet Computer. This module covers the following terms: - Concepts: diff --git a/docs/tutorials/developer-journey/level-1/1.4-using-cycles.mdx b/docs/tutorials/developer-journey/level-1/1.4-using-cycles.mdx index 96c3dae404..a861fcc315 100644 --- a/docs/tutorials/developer-journey/level-1/1.4-using-cycles.mdx +++ b/docs/tutorials/developer-journey/level-1/1.4-using-cycles.mdx @@ -17,8 +17,6 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- - If you recall from the previous module, [Internet Computer terminology](/docs/current/tutorials/developer-journey/level-0/ic-terms), cycles are used to measure the resources, such as memory, storage, and compute power, that are used by a canister. When a canister is deployed on the mainnet, cycles are 'charged' for every action that a canister performs. To obtain cycles, the Internet Computer Protocol's utility token, ICP, can be converted into cycles and transferred into a canister to be used to pay for that canister's consumed resources. Cycles have a fixed price in [XDR](https://internetcomputer.org/docs/current/references/glossary#xdr) in order to make canister costs predictable and independent of the price of ICP. One trillion cycles always correspond to one XDR. @@ -91,8 +89,13 @@ The principal will resemble the following format: tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe ``` +## Acquiring cycles -## Acquiring cycles using a cycles coupon +:::danger +Cycles are required to deploy to the mainnet. If you only plan to deploy to your local environment for testing, cycles are not required. The following tutorials will focus on local deployment to assure anyone can complete this tutorial series. + +You may skip this tutorial if you do not plan to deploy to the mainnet. +::: Cycles can be obtained by converting ICP tokens into cycles. There are a few ways to obtain ICP tokens, such as: @@ -101,129 +104,56 @@ Cycles can be obtained by converting ICP tokens into cycles. There are a few way - Receiving a grant of ICP tokens through the DFINITY Foundation. - Receiving ICP tokens in return for providing resources as a node provider. -For new developers, a free cycles coupon can be obtained and redeemed for 10T free cycles that can be used to get started with dapp deployment. For this tutorial, you'll be obtaining and using that free cycles coupon. - -This coupon is good for new developers since it doesn't require that you transfer ICP tokens into cycles, and doesn't require a purchase of tokens to get started. - -First, navigate to the website [https://faucet.dfinity.org](https://faucet.dfinity.org). - -To obtain a coupon code to use the cycles faucet, you need to put in a written request for the coupon via the [Discord](https://discord.internetcomputer.org) server. - -Click on the **REQUEST CYCLES** button on the faucet web page to join the Discord server. - -![Getting Coupon](../_attachments/faucet_step_1.png) - -Once inside the Discord server, navigate into the `#cycles-faucet` channel. - -![Cycles-faucet](../_attachments/cycles-faucet.png) - -In this channel, execute the following slash command: - -``` -/request -``` +You need to obtain [ICP tokens](https://internetcomputer.org/icp-tokens), then convert them into cycles using `dfx`. However, when participating at DFINITY events like [hackathons](https://dfinity.org/hackathons) or working on a [developer grant](https://dfinity.org/grants), you will receive a coupon which you can redeem to claim free cycles from the [cycles faucet](https://anv4y-qiaaa-aaaal-qaqxq-cai.ic0.app/). -This command will make a call to the IC Cycles Faucet Bot. This bot will prompt you to fill out a survey in the channel. +:::tip +Each developer identity has both a **principal** and a **ledger account identifier**. -Once the survey has been completed, our team will review your submission. If accepted, the faucet bot will send you a private message with a coupon code. +A principal has the format `itk7v-ihlxk-ktdrh-fcnst-vkoou-orj77-52ogl-jqwj5-zpfdv-az3lr-xqe` and is used for canister ownership, management, and holding cycles. -:::info -Please ensure that your Discord settings are set to allow direct messages from other users. If you do not have this setting enabled, you will not receive a direct message from the faucet bot. +A ledger account identifier has the format `e213184a548871a47fb526f3cba24e2ee2fbbc8129c4ab497ef2ce535130a0a4` and is used to send and receive tokens like ICP. ::: -Head back to the [https://faucet.dfinity.org](https://faucet.dfinity.org) webpage. - -Now, click **NEXT STEP** to continue. - -Now that you have a coupon code, enter your coupon code within the faucet UI. - -![Enter Coupon](../_attachments/faucet_step_3.png) +First, get your account's ledger account ID: -Click **NEXT STEP** to continue. - -Return to your terminal window. If you closed the window in the process, run the following commands to start `dfx` and use your previously created identity: - -```bash -dfx start --clean --background -dfx identity use DevJourney ``` - -This workflow utilizes the **cycles ledger** feature. If you'd like to use the **cycles wallet** instead, [view the cycles wallet documentation](/docs/current/developer-docs/defi/cycles/cycles-wallet). - -:::caution -The cycles ledger is supported by default in [`dfx` version 0.22.0 and newer](/docs/current/developer-docs/getting-started/install). -::: - -Then, redeem your coupon with the command: - -```bash -dfx cycles --network ic redeem-faucet-coupon COUPON_CODE -``` - -Replace **COUPON_CODE** with the cycles coupon code sent to you by the DFINITY faucet bot. - -Verify your cycles balance with the command: - -```bash -dfx cycles --network ic balance +dfx ledger account-id ``` -This should return an output showing 10T cycles associated with your identity. - -## Converting ICP tokens to cycles - -If you've already redeemed a cycles coupon in the past, or if you've already used the cycles from your coupon, you can convert ICP tokens into cycles. - -Before you can convert ICP tokens into cycles, first you need to obtain ICP tokens. ICP tokens can be purchased through a crypto exchange, or they can be received through other activities such as participating in the NNS governance and receiving grants from the DFINITY foundation. +Then, send ICP tokens to this ledger account ID. You can obtain [ICP tokens](https://internetcomputer.org/icp-tokens) from an [exchange](https://coinmarketcap.com/currencies/internet-computer/markets) or through a [developer grant](https://dfinity.org/grants). If you are using an exchange, initiate a withdrawal transaction, then enter the ledger account ID as the "destination" address to send ICP tokens to. -To get your account ID so you know where to send your ICP tokens, run the command: +After you have sent ICP tokens to your ledger account, check the ICP balance. -```bash -dfx ledger account-id ``` - -This will display your account number on the ICP ledger, which will resemble the following: - -```bash -e213184a548871a47fb526f3cba24e2ee2fbbc8129c4ab497ef2ce535130a0a4 +dfx ledger balance --network=ic ``` -Once you have sent some ICP to this account ID, you can verify that they were received by checking the balance with the command: +Converting ICP to cycles is done through the **cycles ledger**, a ledger canister that enables developer identities to convert, hold, send, and receive cycles. -```bash -dfx ledger --network ic balance -``` +The price of cycles is fixed against the price of [XDR](/docs/current/references/glossary#xdr), where 1 trillion cycles equals 1 XDR. -This will output something like this: +Cycles are measured in very large numbers, such as billions and trillions. When you talk about cycle transfers and replenishment, you will usually operate with trillions of cycles. -```bash -12.49840000 ICP -``` +:::danger +These commands must be run with the `--network=ic` flag. The cycles ledger is not necessary for local development and therefore not part of the local replica. +::: -Once you have your ICP tokens ready, you will need to convert them into cycles. To convert ICP into cycles using the cycles ledger, use the command: +Next, convert ICP into cycles. Replace `AMOUNT` with the number of ICP tokens you want to convert into cycles. ``` -dfx cycles convert --amount AMOUNT --network ic +dfx cycles convert --amount AMOUNT --network=ic ``` -:::info -This workflow utilizes the **cycles ledger** feature. If you'd like to use the **cycles wallet** instead, [view the cycles wallet documentation](/docs/current/developer-docs/defi/cycles/cycles-wallet). +:::info Calculating how many cycles you need -Please note that the cycles wallet will be removed from dfx in a future release. -::: +The amount of cycles that your canister will use depends on a variety of factors. Cycles are charged for storage, compute, update messages, special features, and more. To get an approximation, you can view the [detailed cycles cost table](/docs/current/developer-docs/gas-cost) or use the [cycles pricing calculator](/docs/current/developer-docs/cost-estimations-and-examples). -Replace the **AMOUNT** with the number of ICP to convert into cycles. +::: -To verify that your ICP was converted into cycles properly, query the balance of the wallet with the command: +Lastly, confirm that the ICP was properly converted into cycles by checking the cycles balance. -```bash -dfx cycles balance --network ic ``` - -This should return your balance in cycles: - -```bash -6.951 TC (trillion cycles). +dfx cycles balance --network=ic ``` ## Resources diff --git a/docs/tutorials/developer-journey/level-1/1.5-deploying-canisters.mdx b/docs/tutorials/developer-journey/level-1/1.5-deploying-canisters.mdx index 7ab9e695e4..0effe5384f 100644 --- a/docs/tutorials/developer-journey/level-1/1.5-deploying-canisters.mdx +++ b/docs/tutorials/developer-journey/level-1/1.5-deploying-canisters.mdx @@ -15,7 +15,9 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip";
- +:::danger +If you did not obtain cycles in the previous tutorial, [1.4 Acquiring and using cycles](/docs/current/tutorials/developer-journey/level-1/1.4-using-cycles), then you can skip this module and continue with the rest of the tutorial series. +::: Now that you have some cycles to pay for your canister's resources, you can deploy your dapp on the mainnet. When a canister is deployed to the mainnet, it's code will be hosted on the nodes that make up one of the mainnet's subnets. The canister will be hosted on these nodes until it is manually uninstalled by the developer, or until it runs out of cycles and is uninstalled automatically. @@ -29,6 +31,10 @@ You will be building off of the previous two modules, [1.3 Developing your first ## Deploying to the mainnet +:::danger +If you did not obtain cycles in the previous tutorial, [1.4 Acquiring and using cycles](/docs/current/tutorials/developer-journey/level-1/1.4-using-cycles), then you can skip this module and continue with the rest of the tutorial series. +::: + To deploy your dapp to the mainnet, first assure that your terminal window is open and you've navigated into the directory of your `poll` dapp that you created in module [1.3 Developing your first dapp](/docs/current/tutorials/developer-journey/level-1/1.3-first-dapp). Then, assure that all necessary packages are installed for the project's frontend with the command: @@ -101,7 +107,7 @@ Uploading assets to asset canister... Deployed canisters. ``` -If you manually converted ICP tokens into cycles, and your cycles balance doesn't contain enough cycles to complete this deployment, you can convert more ICP into cycles with the command: +If your cycles balance doesn't contain enough cycles to complete this deployment, you can convert more ICP into cycles with the command: ```bash @@ -110,8 +116,6 @@ dfx cycles convert 1.005 --network ic This command converts an additional 1.005 ICP tokens to cycles. -If you used the free cycles coupon, this step is not applicable. - Now, let's use your dapp! To access the dapp's frontend, first you need to get the canister's URL. To get this, run the command: ```bash diff --git a/docs/tutorials/developer-journey/level-1/1.6-managing-canisters.mdx b/docs/tutorials/developer-journey/level-1/1.6-managing-canisters.mdx index 7f42a0653f..3729182df7 100644 --- a/docs/tutorials/developer-journey/level-1/1.6-managing-canisters.mdx +++ b/docs/tutorials/developer-journey/level-1/1.6-managing-canisters.mdx @@ -17,8 +17,7 @@ import { GlossaryTooltip } from "/src/components/Tooltip/GlossaryTooltip"; - -Now that you have canisters deployed on the mainnet, the next step is to learn how to manage those canisters. Managing a canister includes workflows such as obtaining information, setting an identity as the canister's owner, and deleting a canister. You'll dive into these different workflows and more in this guide to assure that you have the core fundamentals of how to maintain canisters. +Now that you have canisters deployed, the next step is to learn how to manage those canisters. Managing a canister includes workflows such as obtaining information, setting an identity as the canister's owner, and deleting a canister. You'll dive into these different workflows and more in this guide to assure that you have the core fundamentals of how to maintain canisters. ## The ICP management canister @@ -54,6 +53,12 @@ If you want to get the canister ID for a locally deployed canister, simply omit dfx canister id poll_backend ``` +:::danger + +This tutorial will reference locally deployed canisters from this point forward. + +::: + ## Obtaining canister information Next, to obtain some information about your canister, such as the canister's controller(s) and the Wasm module hash, use the command: @@ -151,13 +156,13 @@ Canisters are placed in the **Running** state by default, but there may be situa To check the current state of all canisters, you can use the command: ```bash -dfx canister status --network ic --all +dfx canister status --all ``` Or, you can check the status of a single canister by specifying it's name, such as: ```bash -dfx canister status poll_backend --network ic +dfx canister status poll_backend ``` The output of the command will resemble the following: @@ -179,13 +184,13 @@ Module hash: 0xf8680eb74022a1079012b7e9c644d1156580002a6126305791811533d3fd6f17 Stopping a canister works in a similar fashion. For example, to stop a single canister, run the command: ```bash -dfx canister stop poll_backend --network ic +dfx canister stop poll_backend ``` Or, to stop all canisters, use the command: ```bash -dfx canister stop --network ic --all +dfx canister stop --all ``` This command displays output similar to the following: @@ -198,7 +203,7 @@ Stopping code for canister poll_frontend, with canister_id 5h5yf-eiaaa-aaaaa-qaa Then you can verify that the canisters have been stopped by rerunning the `dfx canister status` command: ```bash -dfx canister status --network ic poll_backend +dfx canister status poll_backend ``` Which should return: @@ -220,7 +225,7 @@ Module hash: 0xf8680eb74022a1079012b7e9c644d1156580002a6126305791811533d3fd6f17 Then to start the canister again, run the command: ```bash -dfx canister start --network ic --all +dfx canister start --all ``` This will return a confirmation such as: @@ -235,7 +240,7 @@ Starting code for canister poll_frontend, with canister_id 5h5yf-eiaaa-aaaaa-qaa To check a canister's cycles balance, you must be the controller of the canister. The cycles balance can be seen in the output of the `dfx canister status` command, such as: ```bash -dfx canister status 5o6tz-saaaa-aaaaa-qaacq-cai --network ic +dfx canister status poll_backend ``` The output will resemble the following, where the value `Balance` refers to the main cycles balance and `Reserved` refers to the reserved cycles balance: @@ -267,97 +272,7 @@ There are a few ways to top up a canister: - Using the NNS dapp web UI. - Using a third-party service such as [CycleOps](/docs/current/developer-docs/smart-contracts/topping-up/cycles_management_services). -This tutorial will cover the first two workflows. [Learn more about using a third-party service for cycles management](/docs/current/developer-docs/smart-contracts/topping-up/cycles_management_services). - - -## Setting the reserved cycles limit - -When a canister allocates storage bytes, the system may reserve some amount of cycles by moving them from the main cycles balance of the canister to the reserved cycles balance. -These reserved cycles are used for [future storage payments](/docs/current/developer-docs/gas-cost). - -You can control the maximum amount of reserved cycles by setting the reserved cycles limit: - -```bash -dfx canister update-settings 5o6tz-saaaa-aaaaa-qaacq-cai --reserved-cycles-limit 42 --network ic -dfx canister status 5o6tz-saaaa-aaaaa-qaacq-cai --network ic -``` - -The first command sets the reserved cycles limit to `42` and the second command queries the canister status and shows the following output: - -``` -Canister status call result for 5o6tz-saaaa-aaaaa-qaacq-cai. -... -Reserved: 0 Cycles -Reserved Cycles Limit: 42 Cycles -... - -``` - -Once the reserved cycles balances reaches the reserved cycles limit, the system is going to fail all operations that require cycle reservation. -The error message might look like this: - -``` -Canister cannot grow memory by 65536 bytes due to its reserved cycles limit. The current limit (42) would be exceeded by 1000. -``` - -Such errors can be fixed by increasing the reserved cycles limit. - - -### Using ICP - -If you currently have a balance of ICP tokens within your dfx ledger account ID, you can use the `dfx ledger top-up` command to automatically convert that ICP into cycles and deposit it into the specified canister, for example: - -```bash -dfx ledger top-up 5o6tz-saaaa-aaaaa-qaacq-cai --amount 2.7 --network ic -``` - -### Using the cycles ledger - -You can top up a canister using the cycles balance associated with your identity and the cycles ledger with the command: - -```bash -dfx cycles top-up `AMOUNT` `CANISTER_ID` --network ic -``` - -## Getting cycles back from a canister - -To withdraw cycles from a canister, the canister must be deleted. The cycles will be returned to the identity associated with the canister's controller principal. - -First, check the cycles balance of your identity: - -``` -dfx cycles balance -``` - -This will return your cycles balance, such as: - -``` -90.700 TC (trillion cycles). -``` - -Then, you can stop and delete the canister with the commands: - -```bash -dfx canister stop jqylk-byaaa-aaaal-qbymq-cai --network ic -dfx canister delete jqylk-byaaa-aaaal-qbymq-cai --network ic -``` - -The output of the `dfx canister delete` command will return information regarding the cycles withdraw: - -``` -Beginning withdrawal of cycles to canister jqylk-byaaa-aaaal-qbymq-cai; on failure try --no-wallet --no-withdrawal. -Setting the controller to identity principal. -Installing temporary wallet in canister poll_backend to enable transfer of cycles. -Attempting to transfer 3089393970000 cycles to canister jqylk-byaaa-aaaal-qbymq-cai. -Successfully withdrew 3089393970000 cycles. -Deleting canister poll_backend, with canister_id jqylk-byaaa-aaaal-qbymq-cai -``` - -To confirm that the cycles were withdrawn properly, check your cycles balance again with `dfx cycles balance`. The balance should be increased, such as: - -``` -93.789 TC (trillion cycles). -``` +Local development fabricates cycles as needed for canister deployment. To learn about topping up canisters on the mainnet, [read more about how to use ICP or cycles](/docs/current/developer-docs/getting-started/deploy-and-manage#topping-up-canisters) ## Setting the canister's freezing threshold @@ -371,7 +286,7 @@ For example, to set a freezing threshold for your `poll_backend` canister, use t dfx canister update-settings poll_backend --freezing-threshold 3472000 ``` -Then, you can confirm that this threshold has been set by running the `dfx canister status poll_backend --network ic ` command again: +Then, you can confirm that this threshold has been set by running the `dfx canister status poll_backend ` command again: ``` Canister status call result for poll_backend. @@ -388,23 +303,25 @@ Module hash: 0xf8680eb74022a1079012b7e9c644d1156580002a6126305791811533d3fd6f17 ## Deleting a canister -The last portion of canister management that will be covered in this guide is deleting canisters. To delete a single canister, first you need to stop the canister with the command: +The last portion of canister management that will be covered in this guide is deleting canisters. Deleting a canister will withdraw any cycles from that canister and return them to the identity associated with the canister's controller principal. + +To delete a single canister, first you need to stop the canister with the command: ```bash -dfx canister stop poll_frontend --network ic +dfx canister stop poll_backend ``` Then you can run the command: ```bash -dfx canister delete poll_frontend --network ic +dfx canister delete poll_backend ``` When a canister is deleted, the canister's code, state, and canister ID are removed. Canisters must be stopped before they can be deleted. Alternatively, all canisters for a project can be deleted with the commands: ```bash -dfx canister stop --network ic --all -dfx canister delete --network ic --all +dfx canister stop --all +dfx canister delete --all ``` ## Need help? diff --git a/docs/tutorials/developer-journey/level-2/2.5-unit-testing.mdx b/docs/tutorials/developer-journey/level-2/2.5-unit-testing.mdx index b5978d14bc..f1dbe306d5 100644 --- a/docs/tutorials/developer-journey/level-2/2.5-unit-testing.mdx +++ b/docs/tutorials/developer-journey/level-2/2.5-unit-testing.mdx @@ -220,7 +220,6 @@ Then, open your `package.json` file and insert `"test": "vitest"` in the `script "prebuild": "dfx generate", "start": "webpack serve --mode development --env development", "deploy:local": "dfx deploy --network=local", - "deploy:ic": "dfx deploy --network ic", "generate": "dfx generate e2e_tests_backend", "test": "vitest" }, diff --git a/docs/tutorials/developer-journey/level-4/4.1-icp-ledger.mdx b/docs/tutorials/developer-journey/level-4/4.1-icp-ledger.mdx index c1b8565efd..a00733fa49 100644 --- a/docs/tutorials/developer-journey/level-4/4.1-icp-ledger.mdx +++ b/docs/tutorials/developer-journey/level-4/4.1-icp-ledger.mdx @@ -245,7 +245,7 @@ dfx ledger account-id Then, to check the balance of that account, use the command: ```bash -dfx ledger --network ic balance ACCOUNT_ID +dfx ledger balance ACCOUNT_ID ``` Replace `ACCOUNT_ID` with the output from the `dfx ledger account-id` command. diff --git a/sidebars.js b/sidebars.js index 58489500ff..a5904dbf74 100644 --- a/sidebars.js +++ b/sidebars.js @@ -66,9 +66,12 @@ const sidebars = { items: [ { type: "category", - label: "What are canister smart contracts?", + label: "What are canisters?", + link: { + type: "doc", + id: "developer-docs/smart-contracts/overview/introduction", + }, items: [ - "developer-docs/smart-contracts/overview/introduction", "developer-docs/smart-contracts/overview/inside-canisters", "developer-docs/smart-contracts/development-workflow", "developer-docs/smart-contracts/overview/trust-in-canisters", diff --git a/src/css/custom.scss b/src/css/custom.scss index 2e4a88e8cf..30e2ce5fa0 100644 --- a/src/css/custom.scss +++ b/src/css/custom.scss @@ -446,6 +446,17 @@ div[class^="announcementBarContent"] { cursor: pointer; } +.markdown { + & > h1, + & > h2, + & > h3, + & > h4, + & > h5, + & > h6 { + scroll-margin-top: 10rem; + } +} + .gradient-text { background-image: linear-gradient(108.55deg, #3b00b9 0%, #18d0b5 149.76%); } @@ -774,4 +785,4 @@ div[class^="announcementBarContent"] { @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; diff --git a/src/pages/icp-tokens.tsx b/src/pages/icp-tokens.tsx index ac6e575ddf..46d8e98e91 100644 --- a/src/pages/icp-tokens.tsx +++ b/src/pages/icp-tokens.tsx @@ -59,7 +59,7 @@ const WalletCard: React.FC<{
@@ -504,9 +504,10 @@ function TokenHolders(): JSX.Element { - Learn more about custody options + See all wallets + @@ -523,47 +524,26 @@ function TokenHolders(): JSX.Element { transfers.

+ - - - -
- - {/* Column 2 */} - -

Mobile app wallets

+

Mobile app wallets

Mobile apps offer easy access to crypto assets for people who use them frequently. @@ -576,25 +556,25 @@ function TokenHolders(): JSX.Element { icon="/img/showcase/plug_logo.webp" />

- -

- Browser extension wallets -

+ + {/* Column 2 */} + +

Browser extension wallets

Great for users already familiar with crypto wallets from - other chains. + other chains.

@@ -605,64 +585,75 @@ function TokenHolders(): JSX.Element { icon="/img/showcase/plug_logo.webp" />
-
- {/* Column 3 */} - -

Hardware wallets

+

Hardware wallets

Maximum security. Hardware wallets hold private keys in airgapped machines or ledger devices.

-

- Institutional custody -

+
+ {/* Column 3 */} + +

Institutional custody

For anyone managing large amounts of crypto assets. Institutional custodians offer reliability and customer support.

+ + + - + diff --git a/static/img/showcase/logo_bity.png b/static/img/showcase/logo_bity.png new file mode 100644 index 0000000000..4e2ca88f94 Binary files /dev/null and b/static/img/showcase/logo_bity.png differ diff --git a/static/img/showcase/logo_cooper.png b/static/img/showcase/logo_cooper.png new file mode 100644 index 0000000000..884f3dd256 Binary files /dev/null and b/static/img/showcase/logo_cooper.png differ diff --git a/static/img/showcase/logo_primevault.png b/static/img/showcase/logo_primevault.png new file mode 100644 index 0000000000..73158fe030 Binary files /dev/null and b/static/img/showcase/logo_primevault.png differ diff --git a/static/img/showcase/logo_tangem.png b/static/img/showcase/logo_tangem.png new file mode 100644 index 0000000000..c2f6c4cf90 Binary files /dev/null and b/static/img/showcase/logo_tangem.png differ diff --git a/static/img/showcase/logo_trust.png b/static/img/showcase/logo_trust.png new file mode 100644 index 0000000000..d47f821766 Binary files /dev/null and b/static/img/showcase/logo_trust.png differ