Skip to content

libernet-mirror/browser

Repository files navigation

Prerequisites

You need Node.js, Rust, and wasm-bindgen-cli.

Building and Running

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 --release

Optionally run the tests (before cargo build):

browser/crypto$ cargo test

Then generate the JavaScript bindings:

browser/crypto$ wasm-bindgen target/wasm32-unknown-unknown/release/crypto.wasm --out-dir ../crypto-bindings/ --target bundler

Now you can move back to the root and run the full app:

browser/crypto$ cd ..
browser$ npm start

The final native binary is built with:

browser$ npm run package

Updating Submodules

browser$ git submodules foreach git pull

If 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/*.proto

The generated files need to be committed to version control.

About

The Libernet Browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages