A plain program, with no library of ours.
A module takes the name of a procedure, reads the request from its input and writes the answer to its output. The engine makes the same calls as to a server, and does the same with an answer.
| For each call | What a module does |
|---|---|
| Arguments | The name of the connection and the procedure. There is no environment variable. |
| Input | The request of the procedure, in the binary form of Protocol Buffers. |
| Output | The response, in the same form. The module ends with the code 0: that is its answer. |
| Refusal | The code 1 refuses the call, with the reason on its standard error. |
| A new start | Each call starts the module anew. Nothing passes from one call to the next. |
A command of WASI
Most languages build one. metacore atom doc module prints the whole contract: the streams, the exit codes and the clock.
$ metacore atom test rules.wasm \
--procedure metacore.atom.v1.HostService/Ping
outcome answered
fuel 28212860
memory 9 MiB
time 9.807791ms
message -
response {}
The same sandbox, on your machine
metacore atom test runs a module as a cell does, with the same limits and the same fuel. It needs no sign-in.