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 Linux and macOS systems. Other systems may not be compatible with this guide.

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
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-component warg-cli wkg --locked
# Configure default registry
wkg config --default-registry wa.dev

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
Docker for MacOS

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.

brew install make

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.

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

Edit on GitHub

On this page