Skip to main content
Version: 0.82

Iterate

Changing in 1.0+

The term "actor" is deprecated. wasmCloud 1.0 and later simply refer to this entity as a component, reflecting wasmCloud's standardization around WebAssembly components. You can learn more here.

This section describes how you can iteratively build and test your actor functionality.

wash dev

wash dev starts a local wasmCloud host (if you don't already have one started), builds your actor, and automatically registers your actor with the host. It will also watch your actor source code for changes, recompile, and update the actor in the host.

This is a great way to get started with wasmCloud development, and we recommend it for all new actors.

Currently, wash dev only will start the actor, so you'll have to follow the steps in the running the actor section to start the providers your actor needs. We hope to automate as much of that away in the future.

Before running wash dev, you'll need to enable experimental mode for wash:

bash
export WASH_EXPERIMENTAL=true

Alternatively, you can run the command with the --experimental flag:

bash
wash dev --experimental

The output should look like the following:

bash
⚠️   No running wasmcloud host detected (PID file missing), starting a new host...
🔧  Successfully started wasmCloud instance
  Waiting for host to become reachable...
  Found single host w/ ID [NANYXG3E44U4PNBHROWR3KE6V6YK3AP6IJTZVOKH47MGHQJM7ICHG6HK]
🚧  Starting project build
 successfully built project at [/Users/wasmcloud/hello/build/http-hello-world_s.wasm]
👀 watching for file changes (press Ctrl+c to stop)...

This will watch your project's files and, whenever there's a change, recompile and update the actor in the host. Try iterating through a few changes in the Adding Capabilities section to see how it works.

If an actor is handling a message when an update occurs, the host waits for the message handler to complete, then swaps in the newer WebAssembly component before the next message is processed.