Nothing is free in this world. Running an application on the internet requires sources too. To deploy the Web 3 application we need something called cycles which is like fuel to run the application (canister). There are many ways to get Cycles from buying them with ICP tokens to participate in some kind of survey.
But the easiest way, I think, is to get the token from the definite cycles faucet which is free. So I will show you how to get cycles and deploy the application on the internet computer.
First, go to the difinity website
Click the 'Request Cycles' button you will the the first step.
Then it will take you to a discord server.
Agree on the general rules.
Then request a coupon in the '#cycles-faucet' chat.
If you are selected, one of the server craw will send you a message asking to completed a survey first.
After completing it, let the server craw know that you have completed the survey then you will be rewarded with a coupon (The whole process took me around a day).
Go back to the difinity website and enter your coupon.
Check if you have dfx SDK installed in the next step (you should have one if you have already started or completed your application).
Copy the code to create a cycle wallet in your canister.
Go to your project and move to the application folder. Open the command line and run the command you copied above. If you see 'New wallet set', that means it was successful.
You can find a command to check your balance in the last step on the difinity website
Copy it and run it in your project.
Deployment
Run the command to run your application
dfx start
Creating a canister the first time requires lots of fuel so let's be cautious by checking everything before deploying. Run the command to check if you have all the packages installed.
npm i
Then finally deploy
dfx deploy --network ic
If you see 'Deployed canisters' then everything is all set. Click the link for the frontend under URLs.
After deployment I checked my cycles again, it took whopping 6 TC to create one (from 20 TC to 14 TC). But don'e worry, creating a canister for the first time is the most expensive option when working with web 3. Every subsequent deployment won't cost you as much as it does for the firs one (The picture you see below is actually from second deployment).
That is it. If you were successful in deploying one, congrats!
'Backend' 카테고리의 다른 글
Docker - Installation (0) | 2023.03.25 |
---|---|
WSL Installation (0) | 2023.03.07 |
Internet Computer (Web 3) application (0) | 2023.03.07 |