Skip to content

Latest commit

 

History

History
163 lines (106 loc) · 3.45 KB

File metadata and controls

163 lines (106 loc) · 3.45 KB

Installation of the Internet Computer SDK

On Windows

  1. Install Windows Subsystem for Linux:

Run in the command line processor with administrator rights:

wsl --install
  1. Install node.js in WSL:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install node
  1. Install dfx (Internet Computer SDK):
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

On Linux/MacOS

  1. Install node.js:

Under Ubuntu:

sudo apt install npm

Under MacOS:

Install package from the node.js webpage: https://nodejs.org/en/download

  1. Install dfx (Internet Computer SDK):
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

Development Environment

We recommend Visual Studio Code, but you can also use any other IDE, if you prefer.

  1. Install Visual Studio Code.

https://code.visualstudio.com/

  1. If you choose Motoko for the workshop: Install the Motoko plugin (by DFINITY Foundation) in Visual Studio Code.

Menu: View -> Extensions: Search for "Motoko" (Motoko language support by DFINITY Foundation) and install this plugin.

image

  1. Clone the Git repository for local development:
git clone https://github.com/luc-blaeser/auction.git
cd auction

Or, alternatively if you do not have Git installed, you can download the repository as a zip-file from: https://github.com/luc-blaeser/auction

  1. Install the package dependencies in the source folder:
npm install

Preparing the Backend Language

You have a choice of three possible backend languages:

Motoko (recommended)

No extra configuration is needed.

The backend source code is in src/motoko_backend.

Typescript (code name Azle)

  1. Replace the dfx.json file:
cp dfx_typescript.json dfx.json

The backend source code is in src/typescript_backend.

  1. Install podman:

On Ubuntu/WSL:

sudo apt-get install podman

On Mac:

brew install podman

Rust

  1. Replace the dfx.json file:
cp dfx_rust.json dfx.json
  1. Install a recent version of Rust with WebAssembly support:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
  1. Install LLVM/Clang compiler:

On Ubuntu/WSL:

sudo apt-get install clang

On Mac:

brew install llvm

The backend source code is in src/rust_backend.

Testing the Installation

You can run the application locally with dfx:

In the folder auction (of the local repository folder):

dfx start --clean --background
npm run setup
npm start

A local web frontend runs at: http://localhost:3000/

The application is not yet fully functional as the backend is not yet implemented. This is the focus of the workshop.

After testing, you can terminate the npm process and then stop dfx:

dfx stop

Further Information