moxzi
Docs / Getting started / Choosing a runtime

Choosing a runtimealpha

Where to build and where to run your actors, depending on what you're making.

You always build with moxzi. What you choose is where the wasm runs. Since every runtime takes the same module, you can change your mind later without rebuilding.

By use case#

You want toUseNotes
Ship a canister to the Internet Computermoxzi build, then dfx or icp to deployThe wasm installs like one built by moc
Develop and test an actor locallymoxzidStarts in under a second. No replica, no dfx
Run actors as a backend servicemoxzidDurable state, upgrades, timers, HTTPS outcalls, a JSON API
Serve a website from an actormoxzid --web <actor>The actor's http_request method answers at the root URL
Run actors in a web pagemoxzi-webState persists to IndexedDB. The compiler can also run in the page
Add Motoko actors to an existing platformmoxzi host new <platform>Dapr, Restate, Orleans, Akka/Pekko, Proto.Actor, Temporal, Ray, wasmCloud, Cloudflare Workers
Prove which source produced a wasmthe on-chain builder (moxzi build --remote)The build runs in a canister anyone can inspect. Costs cycles
Write a gamemoxzi-gameGame logic is Motoko actors; a shared player draws it

What each runtime provides#

moxzidmoxzi-webInternet Computer
Update and query callsYesYesYes
Rollback on trapYesYesYes
Upgrades with stateYesYesYes
TimersYesYes, when the page drives them (timerMs)Yes
Actor-to-actor callsYesYes, within the pageYes
HTTPS outcallsYesWorker mode, with COOP/COEP headersYes
Durable stateSnapshot and write-ahead logIndexedDBReplicated
Instruction limitsYesOpt-in (meter: true)Yes
Certified responsesNoNoYes
ReplicationSingle nodeSingle tabSubnet consensus

On an actor platform, moxzi runs the actor's code and the platform provides identity, placement, durable storage and timers. Each platform page says what that platform covers.

Certified responses need a subnet's threshold signature, so only the Internet Computer can produce them. If your clients verify certificates (for example, @dfinity/agent's Actor class), they need a real canister.

Building locally or on-chain#

A local build and an on-chain build of the same source produce the same wasm. The on-chain builder is for when someone else needs to verify how a module was built: a DAO approving an upgrade, an auditor, a user of your canister.

Local moxzi buildOn-chain moxzi build --remote
TimeSecondsMinutes
CostFreeCycles, paid in advance and partly refunded
Verifiable by othersNoYes, with moxzi verify
Source privacyStays on your machineThe canister's operators can read uploaded files. Builds from published mops packages upload nothing

See On-chain builds.

Limitations#

LimitationWhat to do
moxzid is a single processRun several servers with different actors. There's no clustering
A browser page can't interrupt a running callUse worker mode (worker: true), which supports deadlines
Deeply nested generated code can overflow the browser's stackCompile with the CLI, or split the generated expressions
One compiler canister runs one build at a timeBuilds queue. Deploy more canisters for parallel builds

Next steps#

On this pageBy use caseWhat each runtime providesBuilding locally or on-chainLimitationsNext steps