Layer LogoWAVS Docs
Build a service

2. System setup

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

System recommendations

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

Linux essentials

If you are on Linux (e.g. Ubuntu), install the build essentials first:

sudo apt update && sudo apt install build-essential

Rust

Run the following command to install Rust.

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

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
Fresh Install

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
Upgrade Rust

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.

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
WSL Ubuntu GLIB out of date

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.

brew install --cask docker
Avoid sudo for Docker

sudo is only required for Docker commands if your user is not in the Docker group. To avoid using sudo with Docker, add your user to the Docker group:

sudo groupadd docker && sudo usermod -aG docker $USER

After adding yourself to the group, log out and back in for the changes to take effect.

Docker for MacOS

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")

Task

Visit the Task Documentation for more info.

brew install go-task

Docker Compose

Visit the Compose Documentation for more info.

Docker Compose is already included with Docker Desktop.

pnpm

Install the latest version of pnpm. pnpm is used by task setup to install JavaScript dependencies.

JQ

Visit the JQ Documentation for more info.

brew 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.

Edit on GitHub

On this page