wasm-pack build --target web
# OR
make build_web_js
# Go in the example directory to build
cd example
npm install
# This command will build the program and embed the proof data in the frontend public dir
# before starting the frontend.
npm start
# Run this anytime to re-generate the proof while frontend is running
npm run build-program
# Test with chrome or any other wasm-pack test target
wasm-pack test --chrome
# Run nodejs tests
make test_js
import init, { Receipt } from "risc0-js";
init().then(() => {
try {
// Deserialize encoded receipt directly
Receipt.bincode_deserialize(receipt).validate(method_id);
} catch (e) {
// ...
}
});