moxzi
Docs / Reference / moxzid reference

moxzid referencealpha

Every moxzid command-line option and environment variable.

moxzid --help prints the same information. The HTTP endpoints are in moxzid HTTP API.

Actors and state#

OptionDefaultEffect
-m, --manifest FILEactors.jsonThe actors to host
-s, --state DIRnoneWhere to keep actor state. Without it, state is in memory only
--snapshot-below BYTES50 MBSnapshot actors this size or smaller after every message; larger actors rely on the log. 0 never snapshots after messages
--live-cap N0 (off)Keep at most N actors loaded; unload the least recently used. Requires -s
--upgrade-policy refuse|warnrefuseWhat to do with an upgrade that changes stable variables when moxzi isn't available to check it

Network and security#

OptionDefaultEffect
-l, --listen ADDR127.0.0.1:7000Address to listen on
--auth-token TOKEN$MOXZID_TOKENBearer token required on protected endpoints
--insecureAllow listening on a non-loopback address without a token
--web ACTORServe this actor's http_request at /
--project DIRServe source closures from DIR at /mops/closure/

Execution limits#

OptionDefaultEffect
--instruction-limit N40,000,000,000Instructions per message. A message that exceeds it traps and is rolled back
--cycles N100,000,000,000,000Each actor's starting cycles. 0 turns charging off
--heartbeat-ms MS1000Heartbeat interval. 0 turns heartbeats off
--timer-ms MS100How often to check for due timers. 0 turns timers off
--grant-http-publicLet actors make HTTPS outcalls to any public host on port 443. Without a grant, outcalls fail with this host cannot make HTTP requests
--outcall-public-host HOSTLet actors reach this public host over HTTPS. Repeat for more hosts
--outcall-development-origin ORIGINLet actors reach this exact origin, port included, such as http://127.0.0.1:8080. For local development
--outcall-timeout-secs S30Time limit for one outcall
--outcall-max-response-bytes BYTES16 MiBHost ceiling for one response body; actors may request less

Tensor device#

See GPU math for actors.

OptionDefaultEffect
--device KINDoffGive hosted actors a tensor device: burn:metal, burn:cuda[:N], burn:vulkan or burn:cpu
--device-listen ADDRoffServe this device's exports to other machines on ADDR (HOST:PORT)
--device-url URLhttp://ADDRThe URL other machines use to reach --device-listen
--device-cycles-per-ms N100,000,000Cycles a device call costs per millisecond, when cycles are charged
--device-checkpoint-secs SECS30With -s, copy the whole device once the recorded device calls took this much device time; startup re-runs about this much. 0 = by size only
--device-checkpoint-mb MB64With -s, copy the whole device after this many MB of recorded device calls

Logging#

OptionDefaultEffect
-v, --verbosePrint actors' Debug.print output on stderr
--log-jsonLog one JSON object per event instead of text
--history N50Recent messages kept per actor for /history. 0 turns it off

Environment variables#

VariableEffect
MOXZID_TOKENThe bearer token, if --auth-token isn't given
MOXZI_BINThe moxzi binary used to check upgrades. Default: next to moxzid, then on PATH

The manifest#

actors.json
{
  "actors": [
    { "name": "counter", "wasm": "counter.wasm" }
  ]
}
FieldRequiredMeaning
nameYesName used in URLs
wasmYesModule path, relative to the manifest
idNoA fixed actor id, in hex

Signals#

SignalEffect
SIGTERM, SIGINTFinish the current message, save every actor, exit with status 0
SIGKILLExit immediately. State is recovered from the log on the next start
On this pageActors and stateNetwork and securityExecution limitsTensor deviceLoggingEnvironment variablesThe manifestSignals