Files
nym/clients/webassembly/js-example
Jędrzej Stuczyński 825791f2c7 Feature/multi surbs basic wasm interface (#1846)
* Added builder to wasm client

* missing wasm_bindgen macros

* Added constructor macro on GatewayEndpointConfig

* Attempting to use updated wasm client api

* Removing dead code

* Exposed other messages types in wasm client

* cleanup in js-example

* Changed 'self_address' to be a method call

* Removed needless borrow when cloning an Arc

* Improving arguments in 'on_message' callback

* fixed wasm-client dependency/features
2022-12-08 17:10:42 +00:00
..
2020-09-28 17:19:07 +01:00
2022-10-10 16:27:51 +01:00
2022-10-26 15:40:03 +01:00

Nym Sphinx Wasm Demo

This example application demonstrates how to use WebAssembly to create Sphinx packets, in the browser, and forward them to a Nym gateway.

🚴 Usage

Build the WASM package for bundling:

wasm-pack build --scope nymproject --target no-modules

in the clients/webassembly directory (one up).

Start the webpack dev server:

npm install         # set up dependencies
npm run start       # starts a web server at http://localhost:8001

Check your dev console for output.

Rebuild after Rust source changes

Install wasm-pack. Instruction are at the Rust WASM tutorial.

wasm-pack build --scope nymproject --target no-modules in the clients/webassembly directory (one up) will rebuild the wasm package if you make changes to the Rust source. That will be automatically picked up (and reloaded, if need be) by the npm dev server.