Skip to content

Commit

Permalink
switch over to miracl_core (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Bloom-dfinity committed Jul 12, 2022
1 parent f004871 commit 97f9352
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 813 deletions.
21 changes: 10 additions & 11 deletions packages/agent/src/vendor/bls/README.md
@@ -1,16 +1,15 @@
# How to generate bls.wasm
# How to Generate `wasm.ts`

The Wasm is generated from the BLS Rust code of the Agent RS (see http://github.com/dfinity/agent-rs/),
with the following `Cargo.toml`.
This WASM is generated from the miracl BLS Rust code (see https://github.com/dfinity/miracl_core_bls12381/)

```
[dependencies]
wasm-bindgen = "0.2.70"
Run the following commands to build, minify, and base64 encode the wasm.

```bash
wasm-pack build --out-name bls --no-default-features --features="wasm-bindgen allow_alt_compress" --profile=wasm

[profile.release]
lto = true
opt-level = 'z'
echo -n "export const wasmBytesBase64 = \`" >pkg/wasm.ts
base64 ./pkg/bls_bg.wasm | tr -d "\n" >>pkg/wasm.ts
echo "\`;" >>pkg/wasm.ts
```

To build the package, run `wasm-pack build --target web`. You can base64 encode the wasm binary and
paste it into `bls.ts`.
Copy the resulting `pkg/wasm.ts` to `packages/agent/src/vendor/bls/wasm.ts`.

0 comments on commit 97f9352

Please sign in to comment.