How to set up Internet Computer development environment.
TL;DR
- Install the Canister SDK
- Build and deploy a dapp locally
- Collect free cycles to power your dapp
- Create a “cycles wallet” from which you can transfer cycles to any other dapps you want to power
- Deploy a dapp on-chain
1. Set up infrastructure
1-1. Get Cycles Faucet
Get Cycles Faucet



1-2. Setup SDK
Setup SDK
dfx
: Difinity execution command-line interface
1
2
3
|
$ sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
$ dfs --version
dfx 0.12.1
|
1-3. Claim cycles
1
2
3
4
5
6
7
8
9
10
|
> dfx identity list
Creating the "default" identity.
WARNING: The "default" identity is not stored securely. Do not use it to control a lot of cycles/ICP.
To create a more secure identity, create and use an identity that is protected by a password using the following commands:
dfx identity create <my-secure-identity-name> # creates a password protected identity
dfx identity use <my-secure-identity-name> # uses this identity by default
Error: Failed to load identity manager.
Caused by: Failed to load identity manager.
Cannot create identity directory at '...': Permission denied (os error 13)
|
- Generate Identity
and set it default
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
> sudo rm -rf leoo
> dfx identity list
anonymous
default *
# dfx identity new <my-secure-identity-name>
> sudo dfx identity new leoo.j
> dfx identity list
anonymous
default *
leoo.j
# dfx identity use <my-secure-identity-name> # uses this identity by default
> sudo dfx identity use leoo.j
Using identity: "leoo.j".
|
- Claim Cycles
1
2
3
4
5
6
7
8
|
> sudo dfx wallet --network ic redeem-faucet-coupon <COUPON_NUMBER>
Please enter the passphrase for your identity: [hidden]
Decryption complete.
> sudo dfx wallet --network=ic balance
Please enter the passphrase for your identity: [hidden]
Decryption complete.
20.099 TC (trillion cycles).
|

2. Hello world locally

I faced some permission error while doing Hello_World
canister. So I posted below issue on ICP forum.
1
2
|
> dfx new hello
> cd hello
|
1
2
3
4
5
|
// base root is hello
> dfx start
Running dfx start for version 0.12.1
Using the default definition for the 'local' shared network because /Users/minwook/.config/dfx/networks.json does not exist.
Dashboard: http://localhost:56958/_/dashboard
|
1
2
3
4
5
6
7
8
9
10
11
12
|
// base root is hello
> yarn install // or npm install
> dfx deploy
...
Deployed canisters.
URLs:
Frontend canister via browser
hello_frontend: http://127.0.0.1:4943/?canisterId=rkp4c-7iaaa-aaaaa-aaaca-cai
Backend canister via Candid interface:
hello_backend: http://127.0.0.1:4943/?canisterId=rno2w-sqaaa-aaaaa-aaacq-cai&id=r7inp-6aaaa-aaaaa-aaabq-cai
|
if you faced frontend build hangs
How to fix dfx deploy infinite hang
- Open package.json file.
- edit scripts like below.
1
2
3
4
|
"scripts": {
...
"generate": "dfx generate hello_backend"
},
|
1
2
3
4
|
"scripts": {
...
"generate": "dfx --identity anonymous generate hello_backend"
},
|
Finally Open your browser and navigate to the url output by the dfx deploy
.
In my case, it is http://127.0.0.1:4943/?canisterId=rkp4c-7iaaa-aaaaa-aaaca-cai
.

3. (OPT) Check my public wallet dashboard
You can check your wallet dashboard by below command.
1
2
3
4
|
> dfx identity --network ic get-wallet
Please enter the passphrase for your identity: [hidden]
Decryption complete.
zze7b-pqaaa-aaaam-abciq-cai
|
With given wallet ID, you can browse your public dashboard site.
Type https://.ic0.app/ on your web browser.

My public ICP Dashboard
- fin -