-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs audit 3 * Update docs/developer-docs/getting-started/troubleshooting.mdx Co-authored-by: Marco Walz <[email protected]> * Update docs/developer-docs/smart-contracts/advanced-features/composite-query.mdx Co-authored-by: Marco Walz <[email protected]> --------- Co-authored-by: Marco Walz <[email protected]>
- Loading branch information
1 parent
0b9fc46
commit dcf12f1
Showing
20 changed files
with
401 additions
and
3,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
docs/developer-docs/getting-started/troubleshooting.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
--- | ||
keywords: [intermediate, test, tutorial, troubleshooting, dfx troubleshooting, ic sdk, dfx, ic sdk troubleshooting] | ||
--- | ||
|
||
import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; | ||
|
||
# IC SDK troubleshooting | ||
|
||
<MarkdownChipRow labels={["Beginner"]} /> | ||
|
||
## Overview | ||
|
||
This section provides information to help you troubleshoot and resolve or work around common issues that are related to the following tasks: | ||
|
||
- Downloading and installing the IC SDK. | ||
|
||
- Creating, building, or deploying canisters. | ||
|
||
- Using the [IC SDK](/docs/current/developer-docs/getting-started/install). | ||
|
||
- Running the local replica. | ||
|
||
## Migrating an existing project | ||
|
||
Currently, there is no automatic migration or backward compatibility for any projects that you might have created using previous versions of the IC SDK. After upgrading to the latest version, you might see error or failure messages if you attempt to build or install a project created with a previous version of the IC SDK. | ||
|
||
In many cases, however, you can continue to work with projects from a previous release by manually changing the `dfx` setting in the `dfx.json` configuration file, then rebuilding the project to be compatible with the version of the IC SDK you have currently installed. | ||
|
||
For example, if you have a project that was created with IC SDK version `0.8.0`, open the `dfx.json` file in a text editor and change the `dfx` setting to the latest version or remove the section entirely. | ||
|
||
## Restarting the local replica | ||
|
||
In some cases, starting the local replica fails due to stale state. If you encounter issues when running `dfx start` to start the local replica: | ||
|
||
- #### Step 1: Interrupt the local replica process through Ctrl+C if necessary, then stop the local replica: | ||
|
||
```bash | ||
dfx stop | ||
``` | ||
|
||
- #### Step 2: If not all `dfx` processes can be stopped, forcibly end them: | ||
|
||
``` | ||
dfx killall | ||
``` | ||
|
||
- #### Step 3: Restart the local replica in a clean state by running the following command: | ||
|
||
```bash | ||
dfx start --clean --background | ||
``` | ||
|
||
The `--clean` option removes checkpoints and stale state information from your project’s cache so that you can restart the local replica and web server processes in a clean state. | ||
|
||
:::danger | ||
Resetting the state information by running `dfx start --clean` removes your existing canisters and new canister IDs may differ from old ones. | ||
::: | ||
|
||
- #### Step 4: Recreate your canisters: | ||
|
||
```bash | ||
dfx canister create --all | ||
dfx build | ||
dfx canister install --all | ||
``` | ||
|
||
## Removing the canisters directory | ||
|
||
If you run into problems building or deploying canisters after successfully connecting to ICP and registering canister identifiers, you should remove the `canisters` directory before attempting to rebuild or redeploy the canisters. | ||
|
||
You can remove the `canisters` directory for a project by running the following command in the project’s root directory: | ||
|
||
```bash | ||
rm -rf ./.dfx/* canisters/* | ||
``` | ||
|
||
## Reinstalling `dfx` | ||
|
||
Some bugs can be addressed by uninstalling and reinstalling the IC SDK: | ||
|
||
```bash | ||
~/.cache/dfinity/uninstall.sh && sh -ci "$(curl -sSL https://internetcomputer.org/install.sh)" | ||
``` | ||
|
||
If you have modified the location of the IC SDK binary (the binary is titled `dfx`), you might want run the following command to uninstall the version of the IC SDK that is in your PATH, then reinstall the latest version of the IC SDK: | ||
|
||
```bash | ||
rm -rf ~/.cache/dfinity && rm $(which dfx) && sh -ci "$(curl -sSL https://internetcomputer.org/install.sh)" | ||
``` | ||
|
||
## Xcode prerequisite | ||
|
||
For macOS environments, you should have **Developer Command Line Tools** installed if you want to create a Git repository for your project. | ||
|
||
You can check whether you have the developer tools installed by running `xcode-select -p`. You can install the developer tools by running `xcode-select --install`. | ||
|
||
## Memory leak | ||
|
||
Fixing memory leaks is an ongoing process. If you encounter any error messages related to memory leaks, you should do the following: | ||
|
||
- #### Step 1: Run `dfx stop` to stop currently running processes. | ||
|
||
- #### Step 2: Uninstall the IC SDK to prevent further degradation. | ||
|
||
- #### Step 3: Re-install the IC SDK | ||
|
||
- #### Step 4: Run `dfx start` to restart replica processes. | ||
|
||
Alternatively, you can remove the `.cache/dfinity` directory and re-install the latest IC SDK `dfx` binary: | ||
|
||
```bash | ||
rm -rf ~/.cache/dfinity && sh -ci "$(curl -sSL https://internetcomputer.org/install.sh)" | ||
``` |
10 changes: 10 additions & 0 deletions
10
docs/developer-docs/smart-contracts/advanced-features/async-code.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.