arnaucube 0a162482ee | 5 years ago | |
---|---|---|
.. | ||
utils | 5 years ago | |
.gitignore | 5 years ago | |
README.md | 5 years ago | |
go-snark-wasm-wrapper.go | 5 years ago | |
go-snark.wasm | 5 years ago | |
index.html | 5 years ago | |
index.js | 5 years ago | |
package.json | 5 years ago | |
server.js | 5 years ago |
Warning: this is an ongoing experimentation
To compile to wasm, inside the wasm
directory, execute:
GOARCH=wasm GOOS=js go build -o go-snark.wasm go-snark-wasm-wrapper.go
Add the file wasm_exec.js
in the directory:
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .
Call the library from javascript:
let r = generateProofs(
JSON.stringify(circuit),
JSON.stringify(setup),
JSON.stringify(px),
JSON.stringify(inputs),
);
Run the http server that allows to load the .wasm
file:
node server.js