mithril-client-wasm
v0.3.5
Published
Mithril client WASM
Readme
Mithril-client-wasm

This is a work in progress 🛠
mithril-client-wasmdefines all the tooling necessary to manipulate Mithril certified types available from a Mithril aggregator from a WASM compatible browser.The different types of available data certified by Mithril are:
- Snapshot: list and get.
- Mithril stake distribution: list and get.
- Cardano transactions: list & get snapshots, get proofs
- Certificate: list, get, and chain validation.
Installation
Install a correctly configured Rust toolchain (latest stable version). You can follow the instructions provided here.
Install the WASM target:
rustup target add wasm32-unknown-unknown- Install Rust WASM Pack:
cargo install wasm-pack- Install clang:
sudo apt install clang- Install
nodejsversion16.15+
sudo apt install nodejs- Install
npmversion8.11+
sudo apt install npm[!WARNING] If you have troubles building the
BLSTlibrary, you will need to:
- Install
Emscripten- For macOS users, consider reading this guide to activate the
emcccommand- Use these environment variables to use this compiler (or prefix all following commands with them):
export CC=emcc export AR=emar
- Install the WASM
emscriptentarget:rustup target add wasm32-unknown-emscripten
Build Mithril client library in WASM
Go to the mithril-client-wasm directory:
cd mithril-client-wasmThen you can build the WASM library:
make buildRun the Mithril client library in the browser
You will need to run the Mithril client library in a compatible browser:
| Browser | Minimum version | Released | Tested in CI |
| --- |:---:|:---:|:---:|
| Chrome | 54 | 2016-10-12 | :heavy_check_mark: |
| Edge | 79 | 2020-01-15 | - |
| Firefox | 38 | 2015-05-12 | :heavy_check_mark: |
| Opera | 41 | 2016-10-25 | - |
| Safari | 15.4 | 2022-03-14 | - |
| Chrome Android | 54 | 2016-10-19 | - |
| Firefox for Android | 38 | 2015-05-12 | - |
| Opera Android | 41 | 2016-10-25 | - |
| Safari on iOS | 15.4 | 2022-03-14 | - |
Go to the mithril-client-wasm directory:
cd mithril-client-wasmInstall the library:
make www-installThen you can serve the Mithril client library in the browser:
make www-serveFinally, open http://localhost:8080 with your browser. (port 8080 is the default port)
