austinabell / risc0-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

risc0-js

Building

wasm-pack build --target web

# OR

make build_web_js

Running example

# 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

Testing

# Test with chrome or any other wasm-pack test target
wasm-pack test --chrome

# Run nodejs tests
make test_js

Usage

import init, { Receipt } from "risc0-js";

init().then(() => {
	try {
		// Deserialize encoded receipt directly
		Receipt.bincode_deserialize(receipt).validate(method_id);
	} catch (e) {
		// ...
	}
});

About


Languages

Language:Rust 30.3%Language:TypeScript 23.4%Language:JavaScript 20.7%Language:HTML 15.3%Language:CSS 8.3%Language:Makefile 1.9%