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 upto start the docker compose stack running to the wasmCloud components and dashboard UI, accessible at localhost:3030.
cdinto thehello-rustdirectory and runwash build. This builds the component in../builddirectory, which is mounted inside the wasmCloud container as specified in the Dockercompose.yamlfile.- Still in the
hello-rustdirectory, runjust deploy(which runswash app deploy wadm.yamlunder the hood) to deploy the hello application. This includes a http capability provider and an actor listening on localhost:8061. - Run
curl localhost:8061to see the actor's response.
- You may need to install Rust.
- You may need to add the
wasi32-wasitarget.- It is installed by running
rustup target add wasm32-wasi
- It is installed by running
cdinto thehello-godirectory and runwash build. This builds the component in../builddirectory, which is mounted inside the wasmCloud container as specified in the Dockercompose.yamlfile.- Still in the
hello-godirectory, runjust deploy(which runswash app deploy wadm.yamlunder the hood) to deploy the hello application. This includes a http capability provider and an actor listening on localhost:8062. - Run
curl localhost:8062to see the actor's response.
- You may need to install TinyGo.
-
Port forward with
just port-forward-natsto 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_EXPERIMENTALto 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": [] }