Skip to content

Commit 97f9352

Browse files
switch over to miracl_core (#590)
1 parent f004871 commit 97f9352

File tree

3 files changed

+15
-813
lines changed

3 files changed

+15
-813
lines changed
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
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`.

0 commit comments

Comments
 (0)