Skip to content

Commit

Permalink
Merge pull request #2655 from dfinity/add-different-workspaces
Browse files Browse the repository at this point in the history
Add info about different developer environments
  • Loading branch information
jessiemongeon1 authored Mar 19, 2024
2 parents 7830811 + 319ba4e commit 517b7a7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
39 changes: 38 additions & 1 deletion docs/developer-docs/getting-started/development-workflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,51 @@ Collectively these functions are referred to as the **System API**.
Developers are not intended to use the System API directly because that would be too low-level and error-prone.
Instead, developers should use language-specific Canister Development Kit (CDK) libraries that are high-level wrappers around the System API.

## Development environments

There are several different environments that can be used to write, deploy, and test smart contracts. Each environment has different characteristics and benefits.

- [`dfx`](/docs/current/developer-docs/getting-started/install/#installing-dfx): `dfx` is the 'native' way to develop smart contracts. It is a command-line tool that enables canister creation and deployment on macOS and Linux systems. `dfx` is developed and maintained by DFINITY, with new features and improvements being released regularly.

- [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install): `dfx` does not natively support Windows operating systems. To use `dfx` locally on a Windows machine, you can install the Windows Subsystem for Linux. Since this workflow isn't the primary development testing environment that `dfx` is designed for, there may be bugs or errors when using `dfx` on WSL. [Learn more about common WSL errors and troubleshooting](/docs/current/developer-docs/getting-started/install).

- [Gitpod](/docs/current/developer-docs/developer-tools/ide/gitpod): Gitpod is an open-source cloud-based development environment that can be used to develop in the web browser without downloading tools or dependencies to your local machine. Gitpod can be used for long-term projects, as it does not use a temporary resource allocation system such as the Motoko Playground. Smart contract projects can be developed using Gitpod by spawning a new Gitpod workspace and configuring it to download and install `dfx`. [The Hello, world! Gitpod example can be used to learn more about Gitpod configuration](https://github.com/dfinity/icp-hello-world-motoko).

- [GitHub Codespaces](https://github.com/codespaces): GitHub Codespaces is a proprietary cloud-based environment similar to Gitpod that can be used to develop smart contracts from within a web browser. To develop smart contracts, you can deploy a new codespace environment and download `dfx`. [The Hello, world! GitHub Codespaces example can be used to learn more about using codespaces](https://github.com/dfinity/icp-hello-world-motoko).

:::info
### Differences between Gitpod and GitHub Codespaces

Gitpod:
- Open-source.
- Choose a repository to deploy into the Gitpod. Must pick an existing repo.
- Choose from several different IDEs to be used in the workspace (VSCode, Terminal, PyCharm, etc).
- Supports snapshots.
- GitLab and Bitbucket integrations.

GitHub Codespaces:
- Proprietary GitHub software.
- Do not need to select an existing repo to deploy into the Codespace. You can choose between several different template development environments that come with pre-installed dependencies, or choose an existing repo.
- Cannot choose between different IDEs to be used in the Codespace.
- Cannot choose between different workspace resources.
- Does not support snapshots.
- Does not integrate with GitLab or Bitbucket.
:::

- Using containers: Developer containers, such as [Docker containers](https://www.docker.com/), can be used for creating smart contracts and deploying them locally in a containerized environment. Containers can be useful for running several different projects simultaneously in your local environment that may be using different versions of `dfx` and different dependencies.

- [Juno](/docs/current/developer-docs/web-apps/frameworks/juno): Juno is a blockchain-as-a-service platform that can be used to create and deploy smart contracts on ICP without using the traditional `dfx` development workflow. Instead, Juno manages ICP-specific tooling for you on the backend through a Juno 'satellite', allowing you to deploy on-chain dapps by interacting with just the Juno web console or through the CLI.

- [Motoko Playground](/docs/current/developer-docs/developer-tools/ide/playground): Motoko Playground is a sandbox environment that can be used for testing smart contract code in any language, not just Motoko. Motoko Playground is only designed for temporary, short-term testing, as there is a 30 minute limit for each deployment. After 30 minutes, the canister will be deleted so the resources can be used for another deployment.

## Deploying smart contracts

A developer can deploy smart contracts either on a local testnet or on the mainnet.
The local testnet comes built-in with `dfx` and can be run with the `dfx start` command.
The local testnet consists of a single node – the local machine.
Note that as of writing, ICP doesn’t have an official public testnet.

In order to deploy smart contracts on the mainnet, the developer needs either ICP tokens or <Tooltip text="Used to pay for ICP gas fees.">cycles</Tooltip>.
In order to deploy smart contracts on the mainnet, the developer needs either ICP tokens or cycles.
When using ICP tokens, `dfx` automatically converts the necessary amount of tokens to cycles since all operations with smart contracts require payment in cycles.
See this [guide](/docs/current/developer-docs/getting-started/cycles/cycles-faucet) for more information on how to obtain cycles.

Expand Down
1 change: 1 addition & 0 deletions docs/developer-docs/getting-started/install/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Currently supported CDKs include:

If you use GitHub Codespaces or [Gitpod](/docs/current/developer-docs/developer-tools/ide/gitpod) to deploy your project, installing these dependencies is not necessary.

:::info
Links to available Codespaces and Gitpod examples can be found in the [hello world example](/docs/current/developer-docs/getting-started/hello-world#create-a-new-project).
:::

Expand Down

0 comments on commit 517b7a7

Please sign in to comment.