File tree Expand file tree Collapse file tree 3 files changed +15
-813
lines changed
packages/agent/src/vendor/bls Expand file tree Collapse file tree 3 files changed +15
-813
lines changed Original file line number Diff line number Diff line change 1- # How to generate bls. wasm
1+ # How to Generate ` wasm.ts `
22
3- The Wasm is generated from the BLS Rust code of the Agent RS (see http://github.com/dfinity/agent-rs/ ),
4- with the following ` Cargo.toml ` .
3+ This WASM is generated from the miracl BLS Rust code (see https://github.com/dfinity/miracl_core_bls12381/ )
54
6- ```
7- [dependencies]
8- wasm-bindgen = "0.2.70"
5+ Run the following commands to build, minify, and base64 encode the wasm.
6+
7+ ``` bash
8+ wasm-pack build --out-name bls --no-default-features --features=" wasm-bindgen allow_alt_compress" --profile=wasm
99
10- [profile.release]
11- lto = true
12- opt-level = 'z'
10+ echo -n " export const wasmBytesBase64 = \` " > pkg/wasm.ts
11+ base64 ./pkg/bls_bg.wasm | tr -d " \n " >> pkg/wasm.ts
12+ echo " \` ; " >> pkg/wasm.ts
1313```
1414
15- To build the package, run ` wasm-pack build --target web ` . You can base64 encode the wasm binary and
16- paste it into ` bls.ts ` .
15+ Copy the resulting ` pkg/wasm.ts ` to ` packages/agent/src/vendor/bls/wasm.ts ` .
You can’t perform that action at this time.
0 commit comments