Developer tool overview
Overview
Developer tools are used to create, manage, and interact with canisters. They can come in several formats, such as command line tools, onchain and off-chain libraries, and integrated development environments. For ICP developers, there are tools within each of these categories available for you to utilize when developing your ICP canisters.
Command line
dfx
dfx
is the primary tool used by developers to create, build, deploy, manage, and call canisters. dfx
is also referred to as the IC SDK, or the Internet Computer Software Development Kit.
dfx
supports local development and deployment through the dfx start
command, which runs a local instance of the ICP replica that can be used to deploy and test canisters on your local machine.
To deploy canisters to the mainnet or make calls to canisters already deployed on the mainnet, the --network ic
flag can be used with most dfx
commands.
dfxvm
dfxvm
is a command-line tool used to installing and switching between different versions of dfx
. It enables developers to pivot between different projects that are built with different dfx
versions.
quill
quill
is a command-line ledger and governance toolkit designed for interacting with the Network Nervous System (NNS) canisters through the use of self-custody keys. It supports using keys in an air-gapped computer, which is a computer that has never been connected to the internet. To support this workflow, quill
first generates and signs messages based on the user input, then the signed messages are transported to a computer with internet connection (via a USB flash drive or QR code) where they are submitted to ICP to be executed.
Off-chain libraries
Agents
An agent refers to an off-chain library that is used to make calls to the public interface of a canister. Agents communicate with the canister's v2
API endpoints.
The following agents are currently developed and maintained by DFINITY:
Additionally, there are several community-developed and maintained agents:
.NET
ICP.NET
by GekctekDart agents:
agent_dart
by AstroX (supports mobile development with Flutter)ic_dart_tools
by Levi Feldman
Go agents:
Java
ic4j-agent
by IC4J (supports Android)Python
ic-py
by RocklabsC
agent-c
by Zondax (C Wrapper for IC Rust Agent)Ruby
ic_agent
by Terry.Tu
Canpack
- Canpack: A tool used to facilitate communication between canisters written in different languages; currently supports calling Rust crates from Motoko canisters.
Canbench
- Canbench: A Rust crate that provides canister benchmarking tooling so developers can gain an insight into how their canister uses memory, instructions, and other resources.
Onchain libraries
Canister development kits (CDKs)
A canister development kit (CDK) is an adapter used by dfx
to provide programming languages with the necessary features and functionality to create, deploy, and manage canisters.
The Rust CDK is developed and maintained by DFINITY for Rust development.
There are several community contributed and maintained CDKs for languages such as:
Integrated development environments (IDEs)
The IDEs listed below are not the only supported IDEs; any IDE can be used to develop canister code.
ICP Ninja
ICP Ninja is a web-based IDE designed specifically for building and deploying ICP canisters. ICP Ninja enables you to write and deploy code directly to the mainnet from the browser. Users can select from several example projects to get started building. Projects deployed through ICP Ninja are available for 20 minutes unless redeployed.
Gitpod
Gitpod is a cloud development environment that is able to run within a web browser. Gitpod can be configured to run dfx
and a local replica instance to support canister development, and there are several example canister projects have been configured to run in Gitpod. This IDE provide a simple and easy way to get started developing on ICP without downloading any tools or setting up an environment.
GitHub Codespaces
GitHub Codespaces is another cloud development environment that is able to run within a web browser without downloading any tools or packages. Similar to Gitpod, Codespaces can be configured to run dfx
and a local replica instance to support canister development, and there are several example canister projects have been configured to run in Codespaces.
Developer containers
Developer containers are a local development workflow using Docker and VS Code. They are a great local development option for developers on Windows systems, since dfx
is not natively supported on Windows.
Playground
The playground is a web-based sandbox environment that can be used with dfx
using the dfx deploy --playground
command. Canisters deployed to the playground borrow resources from a shared canister pool. Because the resources are borrowed, all canisters deployed to the playground will be deleted after 20 minutes. It is designed for small-scale, temporary testing without configuring other developmental parameters. It supports testing canisters written in any language.
Deploying to the playground is ICP's equivalent of deploying to a testnet network.
Visual Studio Code
Visual Studio Code (VS Code) is a popular IDE used for writing code in hundreds of languages. VS Code supports Motoko development through the Motoko VS Code extension that includes type checking, autocompletion, code snippets, and formatting.
The Motoko extension is also available to VSCodium users, who can download it from OpenVSX.
Community tools
The following are community contributed and maintained developer tooling for ICP. Please note that these tools may not be maintained, or may be vulnerable to security flaws. Please use these tools with caution.
IC inspector: A Google Chrome extension that can be used to decode ICP requests and responses.
ic-nix: Support for building ICP projects with Nix.
canister-tools: A series of tools for Rust canisters, such as snapshots and simple upgrades.
wasi2ic: A tool used to convert WASI binaries into binaries runnable on ICP.
setup-dfx: A GitHub Action used to set up
dfx
.