Giter Club home page Giter Club logo

dfx-installation's Introduction

Getting started on Internet Computer

Installing Canister SDK

Windows Installation

  1. Search for terminal and run it as administrator.
    image

  2. Enable feature Windows Subsystem for Linux (WSL).

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    
  3. Set WSL version 2 as default.

    wsl --set-default-version 2
    
  4. Install ubuntu linux

    wsl --install
    
  5. Run ubuntu terminal
    image

    If you encountered an error WslRegisterDistribution failed with error: Ox80370114

    Screenshot 2023-04-28 164514
    Enable the Hyper-V feature. If no error occured do not execute this command.

    dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V /norestart
    

    If no errors occured you should see the welcome message of ubuntu linux

    Screenshot 2023-04-28 165623

  6. Add NodeJS to package repository

    sudo sh -ci "$(curl -fsSL https://deb.nodesource.com/setup_18.x)"
    
  7. Install NodeJS

    sudo apt install nodejs
    
  8. Install dfx

    sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)" 
    
  9. Update path to easily execute dfx command

    PATH="$PATH:$HOME/bin"
    
  10. Verify that dfx is properly installed

    dfx --version
    

    image

Create your identity and wallet

  1. It is not recommended to use the default identity as this will hold your funds in ICP token. To create your new identity:
    dfx identity new yourname
    
    Input a password to secure and encrypt your identity
  2. Add funds to your identity. Creating wallet canister requires atleast 0.03 ICP. You can get ICP from exchange or send me a direct message at discord chan#8942 with your account-id.
    dfx ledger account-id
    
  3. Create your wallet canister. This will hold Cycles.
    dfx ledger create-canister $(dfx identity get-principal) --amount 0.029 --network ic
    
    If you have enough funds and no error occured this will return a canister id.
    Copy the canister id as it will be needed in the next command.
  4. Deploy your wallet canister. Make sure to paste the correct canister id and remove the square brackets.
    dfx identity deploy-wallet [your-canisterid] --network ic
    
  5. Add cycles to your wallet.
    • You can get 20 Trillion Cycles by accomplishing the tasks in DFINITY Faucet.
    • Or send me a dm at discord chan#8942.

Deploy your first DApp on IC

  1. Start IC network on your machine
    dfx start --clean --background
    
  2. Create a new project.
    dfx new mydapp
    

    Replace mydapp to your project name.
    This will create a new directory and files for a sample project.

  3. Go inside the directory. Make sure to replace the mydapp to your project name.
    cd mydapp
    
  4. Compile and deploy to local network
    dfx deploy
    

    It will return a link where you can access and test your canister.

  5. Deploy to main network
    dfx deploy --network ic --with-cycles 300000000000
    

dfx-installation's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.