Skip to content

Latest commit

 

History

History
224 lines (148 loc) · 5.77 KB

File metadata and controls

224 lines (148 loc) · 5.77 KB
title description
2. System setup
Setting up development environment for WAVS

The following installations are required to run this example. Follow the steps below to set up your system.

This tutorial is designed for Windows WSL, Linux, and macOS systems.

Environment

Install VS Code and the Solidity extension if you don't already have them.

Rust

Run the following command to install Rust.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

If you installed Rust using Homebrew, you will need to uninstall it and install it again using the rustup command.

brew uninstall rust

Then run:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

If you just installed Rust for the first time, you will need to run the following commands:

# Install required target and toolchain
rustup toolchain install stable
rustup target add wasm32-wasip2

If you already have a previous version of Rust installed, you will need to run the following commands to upgrade it to the latest stable version:

# Remove old targets if present
rustup target remove wasm32-wasi || true
rustup target remove wasm32-wasip1 || true

# Update and add required target
rustup update stable
rustup target add wasm32-wasip2

Cargo components

Install the following for building WebAssembly components. Visit the Cargo Component documentation for more information.

{/* This section is also in . Remember to update there as well */}

cargo install cargo-binstall
cargo binstall cargo-component wasm-tools warg-cli wkg --locked --no-confirm --force

# Configure default registry
# Found at: $HOME/.config/wasm-pkg/config.toml
wkg config --default-registry wa.dev

# Allow publishing to a registry
#
# if WSL: `warg config --keyring-backend linux-keyutils`
warg key new

If you are on Ubuntu LTS but encounter an error like wkg: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.38' not found (required by wkg):

sudo do-release-upgrade

Foundry

Foundry is a solidity development suite. The Foundry toolchain contains Anvil (a local testnet node), Forge (build and test smart contracts), Cast (an RPC call CLI), and Chisel (a Solidity REPL).

  1. Install Foundryup, the official Foundry installer.
curl -L https://foundry.paradigm.xyz | bash
  1. Install Foundry
foundryup

Docker

Visit the Docker Documentation for more info.

<Tabs groupId="language" items={['MacOS', 'Linux']} persist>

```bash docci-ignore brew install --cask docker ```

The following commands will install Docker and Docker Compose.

```bash docci-ignore
# Install Docker
sudo apt -y install docker.io
# Install Docker Compose
sudo apt-get install docker-compose-v2
```

{/* This section is also in . Remember to update there as well */}

If prompted, remove container with sudo apt remove containerd.io

If you are using Docker Desktop, make sure it is open and running for this tutorial.

Before proceeding, make sure that the following setting is updated:

Enable Host Networking: Open Docker and navigate to -> Settings -> Resources -> Network. Make sure that 'Enable Host Networking' is turned on.

Alternatively, you can install the following:

brew install chipmk/tap/docker-mac-net-connect && sudo brew services start chipmk/tap/docker-mac-net-connect

If you are running on a Mac with an ARM chip, you will need to do the following:

  • Set up Rosetta:
softwareupdate --install-rosetta
  • Enable Rosetta (Docker Desktop: Settings -> General -> enable "Use Rosetta for x86_64/amd64 emulation on Apple Silicon")

Make

Visit the Make Documentation for more info.

<Tabs groupId="language" items={['MacOS', 'Linux']} persist>

```bash docci-ignore brew install make ``` ```bash docci-ignore sudo apt -y install make ```

JQ

Visit the JQ Documentation for more info.

<Tabs groupId="language" items={['MacOS', 'Linux']} persist>

```bash docci-ignore brew install jq ``` ```bash docci-ignore sudo apt -y install jq ```

Node.js

Node v21+ is needed for the WAVS template. Visit the NVM Installation guide to install Node Version Manager and update your Node version.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
nvm install --lts

After setting up your system, continue to the next page to create your project.