Configuring lattice is pretty straight-forward. The main goal in lattice configuration for a wasmcloud host is to supply connection parameters to a NATS server. For anonymous authentication this could simply be the URL and port of the NATS server, or for NATS 2.x decentralized authentication, this can include the client secret (seed key) and the user JWT (the combination of which is referred to as a “credentials file”).
For more information on the various ways you can connect to and configure NATS servers, please consult the NATS documentation.
Configuring the wasmcloud Binary
There are a number of environment variables that can be supplied for the wasmcloud binary. These can also be supplied via command-line options, though for security purposes it’s often preferred to use environment variables as those values cannot be retrieved from the global process list.
|NATS host for lattice RPC|
|NATS port for lattice RPC|
|User JWT for lattice RPC|
|User seed for lattice RPC|
|Creds file for lattice RPC (replaces jwt+seed)|
|NATS host for lattice control interface|
|NATS port for lattice control|
|User JWT for lattice control|
|User seed for lattice control|
|NATS creds file for lattice control (replaces jwt+seed)|
Configuring the wasmcloud Host API
If you are building your own custom wasmcloud host, then you’ll be using the wasmcloud-host crate and the
HostBuilder struct. Please consult the Rust documentation on this crate for information on how to create hosts. It’s worth pointing out that the host and host builder prevent runtime changes to critical components, like the lattice configuration. While you can add and remove actors and capability providers at runtime, you cannot reconfigure the lattice connection while the host is running.