You need Node.js, Rust, and
wasm-bindgen-cli.
The following assumes the root of this repo is the current working directory.
To build the Rust crypto library, first move into the
crypto subdirectory and use cargo:
browser$ cd crypto
browser/crypto$ cargo build --target wasm32-unknown-unknown --releaseOptionally run the tests (before cargo build):
browser/crypto$ cargo testThen generate the JavaScript bindings:
browser/crypto$ wasm-bindgen target/wasm32-unknown-unknown/release/crypto.wasm --out-dir ../crypto-bindings/ --target bundlerNow you can move back to the root and run the full app:
browser/crypto$ cd ..
browser$ npm startThe final native binary is built with:
browser$ npm run packagebrowser$ git submodules foreach git pullIf there have been changes to the crypto submodule you need to rebuild it as described above.
If there have been changes to the proto submodule you'll need to regenerate the message types in
src/proto/. We use the proto-loader-gen-types script provided with
@grpc/proto-loader, which needs to be run
manually:
browser$ ./node_modules/@grpc/proto-loader/build/bin/proto-loader-gen-types.js \
--keepCase \
--longs=String \
--enums=String \
--defaults \
--oneofs \
--grpcLib=@grpc/grpc-js \
--outDir=src/proto/ \
proto/*.protoThe generated files need to be committed to version control.