You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wRPC usage examples for different programming languages can be found at [./examples](./examples).
45
43
46
-
> There are 2 different kinds of examples
47
-
> - Native wRPC applications, using a particular wRPC transport (currently, NATS only)
48
-
> - Generic Wasm components, that run in a Wasm runtime
44
+
There are 2 different kinds of examples:
45
+
- Native wRPC applications, tied to a particular wRPC transport (currently, NATS only)
46
+
- Generic Wasm components, that need to run in a Wasm runtime. Those can be executed, for example, using `wrpc-wasmtime-nats`, to polyfill imports at runtime and serve exports using wRPC.
49
47
50
-
### Generic Wasm components example
48
+
Here is a guide demonstrating how to bootstrap the Rust Wasm component example implemented by:
In this example we will serve and invoke a simple [`hello`](./examples/wit/hello/hello.wit) application
55
+
56
+
#### Requirements
57
+
-`nats-server` >= 2.10.20 or `docker` >= 24.0.6 (or any other OCI runtime)
54
58
-`rust` >= 1.80.1
55
59
56
60
#### How-To
57
-
1. Add the `wasm32-wasi` target
58
-
```bash
59
-
rustup target add wasm32-wasip1
61
+
62
+
In this example we will be using `wasm32-wasip1` target, which is available in stable Rust and configured in [`rust-toolchain.toml`](./rust-toolchain.toml) in the root of this repository. [`wasm32-wasip2`](https://doc.rust-lang.org/nightly/rustc/platform-support/wasm32-wasip2.html) can be used as well.
0 commit comments