This is a quick tutorial to deploy a "Hello World" dapp to the Internet Computer (IC) in 10 minutes or less. Deployment of the dapp only requires basic knowledge of using a terminal.
Before starting, take a look at a version of this dapp running on-chain: https://6lqbm-ryaaa-aaaai-qibsa-cai.ic0.app/
In this tutorial, you will learn how to:
Hello dapp is composed of two canister smart contracts (one for backend and one for frontend). The dapp accepts a text argument as input and returns a greeting. For example, if you call the
greet method with the text argument
Everyone on the command-line via the canister SDK (see instructions below on how to install the canister SDK), the dapp will return
Hello, Everyone! either in your terminal:
$ dfx canister call hello greet Everyone $ "Hello, Everyone"
Or via the dapp in a browser, a pop-up window will appear with the message:
Note that the "Hello World" dapp consists of backend code written in Motoko, a programming language specifically designed for interacting with the IC, and a simple webpack-based frontend.
This tutorial requires Linux, macOS 12.* Monterey or later, or Windows with a Windows Subsystem for Linux (WSL) installation.
To build and deploy the
Hello dapp, you need to install the following tools.
In this tutorial, we use a Canister SDK called
dfx, which is the default SDK maintained by the DFINITY foundation.
sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
To verify that
dfx properly installed, run:
The terminal should show you the most recent version (See SDK release notes).
More installation options and instructions for uninstalling
dfx are covered in Installing the SDK.
Node.js is necessary for rendering the frontend assets and so is necessary to complete this tutorial. Note however that Node.js is not needed for canister development in general.
We support all stable versions of Node.js starting with 12. You can install 12, 14, or 16. Please note that Node 17 does not support Webpack’s api proxy tool, so
npm start may not work correctly.
This tutorial works best with a node.js version higher than