Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,203 changes: 671 additions & 532 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ alloy-serde = "=1.0.42"
alloy-tx-macros = "=1.0.42"
alloy-eip2930 = "=0.2.1"
alloy-eip7702 = "=0.6.1"
alloy-json-rpc = "=1.6.3"

layer-climb = "0.8.3"
layer-climb-address = { version = "0.8.3", features = [
Expand Down
22 changes: 10 additions & 12 deletions checksums.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
6ffcff544f5c26555471d8dbea23d005ae5918cca9415291aa8436b8f2872714 ./examples/build/components/chain_trigger_lookup.wasm
ec18fdff03c870396e52fbffe28e9678ea8a5f954f3cefffff1e80f205c1a67c ./examples/build/components/cosmos_query.wasm
dc2ac2f4d93315543c3678474ec56286bc6c9053363e542c0c9ceaa8da0dcedf ./examples/build/components/echo_block_interval.wasm
db1505440283a8776b88cd26288da06f0c9f4bffea6427c5a7b80b74d8918965 ./examples/build/components/echo_cron_interval.wasm
45b9f0f16afb57bb80548ad78d48c0e72187519c4a7f3ca23c5e0556ab6ae093 ./examples/build/components/echo_data.wasm
2567044104ab4f695169eeccfdc2982e592c6e00ad735524fee59314efb2e1f0 ./examples/build/components/example_helpers.wasm
82cb78c2cf3d7e125b8ef2965a314796548a6fd5fe8be4c590c21edcb98848b4 ./examples/build/components/example_types.wasm
1f77a617bf9facc11c3f9500369349de55e54b0578153f203d2f3b0bbedfdec7 ./examples/build/components/kv_store.wasm
9eec3fef1069a05d3eddaff9ede6f3cc279fe6d9d115f4b7b994e5f64b240c52 ./examples/build/components/permissions.wasm
28dd543801b07c043a42592577470b70c1d6de8af91359c84db06dd2cd291ce3 ./examples/build/components/simple_aggregator.wasm
58221668b0186d2948f08f76c2b4a3a820c232a4ee622626862d3d00868c3448 ./examples/build/components/square.wasm
2641526533d5138f1a2eef91428c9fe0cb678ecd87325434ee91a3af7900da9c ./examples/build/components/timer_aggregator.wasm
e9e5d95777a9fea81db88c64d4747ad1f4111eab2e839a21078836b18d5f2e69 ./examples/build/components/chain_trigger_lookup.wasm
da340a29f8050546d861546c462d9dc58f8fdfc0c1eeb2d20a90f2f493228e5f ./examples/build/components/cosmos_query.wasm
2d8c997e3697c20fbbb3ea7062d31150f0017a144387a08c554eefd92557c458 ./examples/build/components/echo_block_interval.wasm
9edd139b72286e745190fdaebcc099584cb91a91f67fa666a103dc2804b9d7dd ./examples/build/components/echo_cron_interval.wasm
1a4859aa1af89ca6bd67059ed19a33c25ed8a218a3f5c5e41e4b1c0994de2c6c ./examples/build/components/echo_data.wasm
85e2f126dcb9ddc2aa3994ccd0d43c23cf5d985a6103c7d37a3979707baaa7c7 ./examples/build/components/kv_store.wasm
7be83b504166378b0f06aeda03fa596a8a0b87c00382b873104b3a32d6795ea0 ./examples/build/components/permissions.wasm
74b6cdd4b65c69ec80bc5fef2720fe5f5979efe00541e71ddaa8056a0d688adc ./examples/build/components/simple_aggregator.wasm
6314be3ee1b17584792da9e03a6326862dbaa47257103d8f057393ca2e33fbc8 ./examples/build/components/square.wasm
0fec8f6ffba5acf66ad0d3cec33ba370c6f789b5973c02c0d721e373afddeb45 ./examples/build/components/timer_aggregator.wasm
Binary file modified examples/build/components/chain_trigger_lookup.wasm
Binary file not shown.
Binary file modified examples/build/components/cosmos_query.wasm
Binary file not shown.
Binary file modified examples/build/components/echo_block_interval.wasm
Binary file not shown.
Binary file modified examples/build/components/echo_cron_interval.wasm
Binary file not shown.
Binary file modified examples/build/components/echo_data.wasm
Binary file not shown.
Binary file removed examples/build/components/example_helpers.wasm
Binary file not shown.
Binary file removed examples/build/components/example_types.wasm
Binary file not shown.
Binary file modified examples/build/components/kv_store.wasm
Binary file not shown.
Binary file modified examples/build/components/permissions.wasm
Binary file not shown.
Binary file modified examples/build/components/simple_aggregator.wasm
Binary file not shown.
Binary file modified examples/build/components/square.wasm
Binary file not shown.
Binary file modified examples/build/components/timer_aggregator.wasm
Binary file not shown.
61 changes: 18 additions & 43 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SUDO := if `groups | grep -q docker > /dev/null 2>&1 && echo true || echo false` == "true" { "" } else { "sudo" }
TAG := env_var_or_default("TAG", "")
WASI_OUT_DIR := "./examples/build/components"
COMPONENTS_DIR := "./examples/components"
COSMWASM_OUT_DIR := "./examples/build/contracts"
REPO_ROOT := `git rev-parse --show-toplevel`
DOCKER_WAVS_ID := `docker ps | grep wavs | awk '{print $1}'`
Expand Down Expand Up @@ -52,60 +53,34 @@ _install-native HOME DATA:
@echo "export WAVS_CLI_DATA=\"{{DATA}}/wavs-cli\""
@echo "export WAVS_DOTENV=\"{{HOME}}/.env\""

wasi-build-native COMPONENT="*":
@if [ "{{COMPONENT}}" = "*" ]; then \
rm -f ./target/wasm32-wasip1/release/*.wasm; \
fi

@for C in examples/components/{{COMPONENT}}/Cargo.toml; do \
if [ "{{COMPONENT}}" != "_helpers" ] && [ "{{COMPONENT}}" != "_types" ]; then \
echo "Building WASI component in $(dirname $C)"; \
( cd $(dirname $C) && cargo component build --release && cargo fmt); \
fi; \
done

rm -rf {{WASI_OUT_DIR}}
mkdir -p {{WASI_OUT_DIR}}
@cp ./target/wasm32-wasip1/release/*.wasm {{WASI_OUT_DIR}}
@sha256sum -- {{WASI_OUT_DIR}}/*.wasm | tee checksums.txt

# FIXME
# https://github.com/Lay3rLabs/wasi-builder/issues/2
# https://github.com/Lay3rLabs/wasi-builder/issues/3
wasi-build-docker COMPONENT="*" TAG="latest":
wasi-build COMPONENT="*" TAG="latest":
#!/usr/bin/env bash
set -euo pipefail

IMAGE_NAME="ghcr.io/lay3rlabs/wasi-builder:{{TAG}}"

# Determine which directories to process
if [ "{{COMPONENT}}" = "*" ]; then
# Find all directories in examples/components that don't start with _
COMPONENTS_DIR="examples/components"
COMPONENTS=$(find "$COMPONENTS_DIR" -maxdepth 1 -type d -name "[!_]*" | sed 's|^\./||' | sort)
if [ -z "$COMPONENTS" ]; then
echo "No component directories found in $COMPONENTS_DIR (excluding directories starting with _)"
exit 1
fi
else
COMPONENTS="{{COMPONENT}}"
fi

# Create and clean output directory
rm -rf "{{WASI_OUT_DIR}}"
mkdir -p "{{WASI_OUT_DIR}}"

# Pull latest (unless tag is local)
if [ "{{TAG}}" != "local" ]; then
docker pull $IMAGE_NAME
fi

# Run Docker build
docker run --rm \
-v "$(pwd):/docker" \
-v "$(pwd)/{{WASI_OUT_DIR}}:/docker/output" \
-e HOST_UID=$(id -u) -e HOST_GID=$(id -g) \
"$IMAGE_NAME"
if [ "{{COMPONENT}}" = "*" ]; then
docker run --rm \
-v "$(pwd):/docker" \
-v "$(pwd)/{{WASI_OUT_DIR}}:/docker/output" \
-e HOST_UID=$(id -u) -e HOST_GID=$(id -g) \
-e COMPONENTS_DIR="{{COMPONENTS_DIR}}" \
-e EXCLUDE_FOLDERS="_helpers,_types" \
"$IMAGE_NAME"
else
docker run --rm \
-v "$(pwd):/docker" \
-v "$(pwd)/{{WASI_OUT_DIR}}:/docker/output" \
-e HOST_UID=$(id -u) -e HOST_GID=$(id -g) \
-e COMPONENTS_DIR="{{COMPONENTS_DIR}}" \
"$IMAGE_NAME" "{{COMPONENT}}"
fi

just generate-checksums

Expand Down
1 change: 1 addition & 0 deletions packages/version-pins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ alloy-tx-macros = { workspace = true }
alloy-eip2930 = { workspace = true }
alloy-eip7702 = { workspace = true }
alloy-transport = { workspace = true }
alloy-json-rpc = { workspace = true }