#!/bin/sh # Build the deployed client with TinyGo, and run the packages it ships under TinyGo too. # # The client runs in a browser, so the compiler that produces the real artifact is TinyGo, not # Go. A test that only ever runs under Go can pass while the deployment build breaks, so the # packages the wasm binary ships are checked with the same compiler here. # # GO=/path/to/go1.24.6 ./scripts/build-wasm.sh [output.wasm] # set -eu export GOROOT=${GOROOT:-/home/mleku/sdk/go1.24.6} export PATH=$GOROOT/bin:$PATH OUT=${1:-bin/nostrino-channel.wasm} mkdir -p "$(dirname "$OUT")" echo "tinygo build -> $OUT" tinygo build -target wasm -o "$OUT" ./cmd/nostrino-channel echo "tinygo test: packages the wasm build ships" tinygo test -target wasm ./pkg/btcwire ./pkg/chain