WAVS EAS Template
Template for getting started with developing WAVS applications
A Ethereum Attestation Service template for developing Web Assembly Verifiable Services using Rust and Solidity, configured for Windows WSL, Linux, and MacOS.
Core (Docker, Compose, Make, JQ, Node v21+, Foundry)
- Linux:
sudo apt update && sudo apt install build-essential
If prompted, remove container with sudo apt remove containerd.io.
- MacOS:
brew install --cask docker - Linux:
sudo apt -y install docker.io - Windows WSL: docker desktop wsl &
sudo chmod 666 /var/run/docker.sock - Docker Documentation
Note:
sudois only used for Docker-related commands in this project. If you prefer not to use sudo with Docker, you can add your user to the Docker group with:sudo groupadd docker && sudo usermod -aG docker $USERAfter adding yourself to the group, log out and back in for changes to take effect.
- MacOS: Already installed with Docker installer
sudo apt remove docker-compose-pluginmay be required if you get adpkgerror - Linux + Windows WSL:
sudo apt-get install docker-compose-v2 - Compose Documentation
- MacOS:
brew install make - Linux + Windows WSL:
sudo apt -y install make - Make Documentation
- MacOS:
brew install jq - Linux + Windows WSL:
sudo apt -y install jq - JQ Documentation
- Required Version: v21+
- Installation via NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
nvm install --ltscurl -L https://foundry.paradigm.xyz | bash && $HOME/.foundry/bin/foundryupRust v1.85+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup toolchain install stable
rustup target add wasm32-wasip2# 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-wasip2Cargo Components
On Ubuntu LTS, if you later encounter errors like:
wkg: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by wkg)
wkg: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by wkg)If GLIB is out of date. Consider updating your system using:
sudo do-release-upgrade# Install required cargo components
# https://github.com/bytecodealliance/cargo-component#installation
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 foundry is not installed:
# `curl -L https://foundry.paradigm.xyz | bash && $HOME/.foundry/bin/foundryup`
forge init --template Lay3rLabs/wavs-eas my-wavs-eas-app --branch mainTip
Run make help to see all available commands and environment variable overrides.
Install the required packages to build the Solidity contracts. This project supports both submodules and npm packages.
# Install packages (npm & submodules)
make setup
# Build the contracts
forge build
# Run the solidity tests
forge testNow build the WASI components into the compiled output directory.
Warning
If you get: error: no registry configured for namespace "wavs"
run, wkg config --default-registry wa.dev
Warning
If you get: failed to find the 'wasm32-wasip1' target and 'rustup' is not available
brew uninstall rust & install it from https://rustup.rs
make wasi-buildHow to test the component locally for business logic validation before on-chain deployment.
TODO! Update this to actually work with our components
make wasi-execExpected output:
Note
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")
Configure one of the following networking:
- Docker Desktop: Settings -> Resources -> Network -> 'Enable Host Networking'
brew install chipmk/tap/docker-mac-net-connect && sudo brew services start chipmk/tap/docker-mac-net-connect
Start an ethereum node (anvil), the WAVS service, and deploy eigenlayer contracts to the local network.
Set Log Level:
- Open the
.envfile. - Set the
log_levelvariable for wavs to debug to ensure detailed logs are captured.
Note
To see details on how to access both traces and metrics, please check out Telemetry Documentation.
# This must remain running in your terminal. Use another terminal to run other commands.
# You can stop the services with `ctrl+c`. Some MacOS terminals require pressing it twice.
cp .env.example .env
# update the .env for either LOCAL or TESTNET
# Starts anvil + IPFS, WARG, Jaeger, and prometheus.
make start-all-localThis script automates the complete WAVS deployment process in a single command:
- Build Check: Rebuilds WebAssembly component if changes detected
- Create Deployer: Sets up and funds deployer account
- Deploy Eigenlayer: Deploys service manager contract
- Deploy Contracts: Creates trigger and submission contracts
- Upload Component: Publishes WebAssembly component to WASI registry
- Build Service: Creates service configuration
- Upload to IPFS: Stores service metadata on IPFS
- Set Service URI: Registers IPFS URI with service manager
- Start Aggregator: Launches result aggregation service
- Start WAVS: Launches operator service with readiness check
- Deploy Service: Configures WAVS to monitor trigger events
- Generate Keys: Creates operator signing keys
- Register Operator: Registers with Eigenlayer AVS (0.001 ETH stake)
- Verify Registration: Confirms operator registration
Result: A fully operational WAVS service that monitors blockchain events, executes WebAssembly components, and submits verified results on-chain.
export RPC_URL=`bash ./script/get-rpc.sh`
export AGGREGATOR_URL=http://localhost:8001
bash ./script/deploy-script.shSimple demo showing how to create a schema, trigger an attestation request, and view results.
This demo walks you through the complete attestation workflow:
- Register a Schema - Define the structure for attestations (like a database table schema)
- Trigger an Attestation - Request WAVS to create an attestation using your schema
- View Results - Check that the attestation was successfully created on-chain
Set these variables from deployment output:
# Parse deployment addresses from .docker/deployment_summary.json
export RPC_URL=`bash ./script/get-rpc.sh`
export SERVICE_TRIGGER_ADDR=$(jq -r '.service_contracts.trigger' .docker/deployment_summary.json)
export EAS_ADDR=$(jq -r '.eas_contracts.eas' .docker/deployment_summary.json)
export SCHEMA_REGISTRAR_ADDR=$(jq -r '.eas_contracts.schema_registrar' .docker/deployment_summary.json)
export EAS_INDEXER_ADDR=$(jq -r '.eas_contracts.indexer' .docker/deployment_summary.json)
export INDEXER_RESOLVER_ADDR=$(jq -r '.eas_contracts.indexer_resolver' .docker/deployment_summary.json)Register a custom schema for skill attestations.
What this does: Creates a new schema in the EAS schema that defines the structure of attestations. This schema specifies that attestations will contain a message. The indexer resolver will automatically index attestations for this schema onchain (only suitable for L2s / cheaper EVM environments).
# Capture the forge output and extract schema UID automatically
forge script script/Schema.s.sol:EasSchema \
--sig "registerSchema(string,string,string,bool)" \
$SCHEMA_REGISTRAR_ADDR \
"string message" \
$INDEXER_RESOLVER_ADDR \
true \
--rpc-url $RPC_URL \
--broadcast \
--legacy 2>&1 | tee schema_output.log
# Extract schema UID using helper script
export SCHEMA_UID=$(bash script/extract-schema-uid.sh schema_output.log)
echo "Schema UID: $SCHEMA_UID"Create an attestation request using your schema.
What this does: Emits an AttestationRequested event that the WAVS operator monitors. The WAVS service will process this request, execute the WebAssembly component, and create an actual EAS attestation on-chain.
# Trigger attestation creation via WAVS
forge script script/Trigger.s.sol:EasTrigger --sig "triggerRawAttestation(string,string,string,string)" \
"${SERVICE_TRIGGER_ADDR}" \
${SCHEMA_UID} \
"0x742d35Cc6634C0532925a3b8D4f3e9dC9BfD16BB" \
"Advanced Solidity Development Skills Verified" \
--rpc-url $RPC_URL --broadcastCheck the attestation was created.
What this shows: Verifies that the WAVS operator successfully processed your request and created the attestation. You should see the attestation data stored on-chain in the EAS registry.
# Query attestations for the schema and recipient
forge script script/Trigger.s.sol:EasTrigger --sig "queryAttestations(string,string,string,string,uint256)" \
"${EAS_INDEXER_ADDR}" \
"${EAS_ADDR}" \
"${SCHEMA_UID}" \
"0x742d35Cc6634C0532925a3b8D4f3e9dC9BfD16BB" \
10 \
--rpc-url $RPC_URLThis template contains rulefiles for building components with Claude Code and Cursor. Read the AI-powered component creation guide for usage instructions.
To spin up a sandboxed instance of Claude Code in a Docker container that only has access to this project's files, run the following command:
npm run claude-code
# or with no restrictions (--dangerously-skip-permissions)
npm run claude-code:unrestricted