This repo is for building Proof-of-Concept (PoC) wasmCloud applications. The goal is to deepen my understanding of wasmCloud, its internals, its strengths, its weaknesses, and how the developer experience (DX) is when building applications with it.
The below steps will guide you through setting up the wasmCloud stack and deploying both a Rust and Go Actors & capability providers. Finally we will explore integrating both actors, and integrating an access control solution.
- Install the pre-requisites:
- Run
just up
to start the docker compose stack running to the wasmCloud components and dashboard UI, accessible at localhost:3030.
cd
into thehello-rust
directory and runwash build
. This builds the component in../build
directory, which is mounted inside the wasmCloud container as specified in the Dockercompose.yaml
file.- Still in the
hello-rust
directory, runjust deploy
(which runswash app deploy wadm.yaml
under the hood) to deploy the hello application. This includes a http capability provider and an actor listening on localhost:8061. - Run
curl localhost:8061
to see the actor's response.
- You may need to install Rust.
- You may need to add the
wasi32-wasi
target.- It is installed by running
rustup target add wasm32-wasi
- It is installed by running
cd
into thehello-go
directory and runwash build
. This builds the component in../build
directory, which is mounted inside the wasmCloud container as specified in the Dockercompose.yaml
file.- Still in the
hello-go
directory, runjust deploy
(which runswash app deploy wadm.yaml
under the hood) to deploy the hello application. This includes a http capability provider and an actor listening on localhost:8062. - Run
curl localhost:8062
to see the actor's response.
- You may need to install TinyGo.
-
Port forward with
just port-forward-nats
to be able to use wash against the k8s instance of NATS (which is what wash uses to interact with wasmCloud). -
You can use
wash spy {actor_id}
to see the interactions of an actor. As of 26-03-2024, you must enableWASH_EXPERIMENTAL
to use this feature. Example output:❯ WASH_EXPERIMENTAL=true wash spy MAGFAN3NPIDLH3W63R3BMXIEAQATMRVZ4L3BI6DNYA324ZKO4CUHCXR6 Spying on actor MAGFAN3NPIDLH3W63R3BMXIEAQATMRVZ4L3BI6DNYA324ZKO4CUHCXR6 [2024-03-26 19:27:13.838474712 +01:00] From: HTTP Server To: MAGFAN3NPIDLH3W63R3BMXIEAQATMRVZ4L3BI6DNYA324ZKO4CUHCXR6 Host: NDHZQJ4HIDR6IWI3XDOVPWPGCN5JNK4JKJHJ6D3GUTYGMGHNSXT6MKEN Operation: HttpServer.HandleRequest Message: { "method": "GET", "path": "/", "queryString": "", "header": { "host": [ "localhost:8061" ], "user-agent": [ "curl/8.6.0" ], "accept": [ "*/*" ] }, "body": [] }