monad_attest and gpio_write. This tutorial installs the starter package, then points at the two files you replace for a real machine.
You need Rust on the machine where you compile. The device that runs the plugin does not need a compiler. Copy the package over after kinetic build if those are different machines.
Scaffold
manifest.toml, a SOP, a skill, a record schema, and the WIT files under wit/v0.
Open src/lib.rs. The starter exports two tools, ping and note. ping returns pong. note stores text in host state and returns the previous value. Both are real tools. You can install them before you replace them.
Build
plugin.wasm and its SHA-256, and writes that hash into manifest.toml. If Cargo is missing, the command says so and stops. The device binary does not bundle a compiler.
Install
On the device:- seeds a
plugins.entriesrow, and grants any egress hosts the manifest declares, - copies
sop/into the SOP directory when SOP is enabled, leaving an existing procedure of the same name in place, - replaces
[records]in the device config withrecords.example.tomlwhen that file is present.
ping. The tool result is pong.
Replace the starter
For the vending machine, replaceping and note with the tools the procedure calls. A lookup tool is enough to start:
monad_attest.
Then replace three more files before you install again:
kinetic plugin install again replaces the record fields. It does not overwrite a SOP directory that is already installed. If you changed sop/ after the first install, copy the new files into ~/.kinetic/sops/vending/ yourself, or remove that directory first.
Rebuild after every change to
src/lib.rs. The installed component is the wasm file, not the Rust source.When a tool needs the network or a secret
Declare the host under[egress] in manifest.toml, and add http_client to permissions. The first install grants those hosts and prints the kinetic config set command that edits the grant later. A reinstall does not widen a grant that is already there.
A secret is a string property in [config_schema] with x-secret = true, plus config_read in permissions. Set the value with: