Packaging & signing your app
Once your app compiles, it still has to become something a node can install.
That deliverable is an .mpk bundle: a single archive carrying your
calimero:app component, a manifest.json, and an Ed25519 signature.
This page walks the builder workflow that produces one.
Every step is a meroctl app subcommand: build compiles the components, signer
makes the signing key, pack writes the manifest, signs it and packs the
archive, and inspect checks the result as a node would. The node
side — how a bundle is parsed, verified, and trusted on install — lives in
Upgrades & migration; this page does not duplicate that
detail.
The workflow
Section titled “The workflow”-
Build the component.
meroctl app buildcompiles your crate forwasm32-wasip2and turns it into acalimero:appcomponent, with the ABI the SDK’s macros embed (itscalimero:abisection).meroctlcomes with each release, besidemerod(Install).Terminal window meroctl app build apps/my-app --out my-app.wasmA WASM core module (an SDK 0.12 app) is refused by the node (
400 UNSUPPORTED_BUNDLE). -
Generate a signing key (one-time).
meroctl app signer newcreates an Ed25519 keypair and derives your signer id — adid:keyidentifier built from the public key (the0xed01ed25519-pub multicodec tag plus the 32-byte key, base58btc-encoded under thedid:key:prefix).Terminal window meroctl app signer new my-signing-key.json# Generated new keypair: my-signing-key.json# signerId: did:key:z6Mkrb81NKkv7Mw4dZAWA5PTuwBhbq9u9eCPuby3icBUdirgThe key file is JSON with base64url-encoded
private_keyandpublic_keyplus the derivedsigner_id(meroctl app signer id <file>prints it again).signer newwill not overwrite an existing file unless you pass--force, which loses the old key for good. Keep it secret and out of version control — it is your update authority (see below). -
Write and sign the manifest, and create the
.mpk.meroctl app packwritesmanifest.json(version,package,appVersion,minRuntimeVersionand theapp.wasmartifact with its SHA-256 and size), signs it, and packsmanifest.jsonandapp.wasminto a gzip-compressed tar. Signing derives thesignerIdfrom the key, refuses to sign ifminRuntimeVersionis absent (a signer must not rewrite the document it signs), canonicalizes the manifest with RFC 8785 (JCS), signs the domain-tagged SHA-256 of those canonical bytes, and writes asignatureobject back into the manifest.Terminal window meroctl app pack --wasm my-app.wasm --package com.example.my-app \--app-version 1.0.0 --key my-signing-key.json --out dist/com.example.my-app-1.0.0.mpk# omit --key to sign with the development keymeroctl app inspect dist/com.example.my-app-1.0.0.mpk # verify it as a node doesGiven the crate’s directory instead,
meroctl app pack apps/my-app --key my-signing-key.jsonreadspackage,min-runtime-versionandfrontend-dirfrom the crate’s[package.metadata.calimero]and the release from itsversion, builds the components when--wasmand--computeare not given, and writesapps/my-app/dist/<package>-<version>.mpk. The same table gives the displaymetadata(name,description,author,icon,tags,license,category,guide),handlers.slug,links(frontend,github,docs) andfrontendAliases, and the crate’scalimero-sdkgit dependency givesbuildInfo(sdkSource,sdkVersion: the SDK it was built with).--min-runtime-version(default0.1.0) is the oldestmerodrelease the app needs; a cluster with an older replica refuses the upgrade (409 RUNTIME_TOO_OLD). For every release after the first, pass--previous <last .mpk>:packthen compares the two ABIs, warns about changes that break callers, and refuses a state change made without a state version bump (App interface).The other fields a release may carry:
Flag Manifest field --frontend <dir>,--frontend-entry <file>frontendthe app’s static web build, served by the node (Ship a frontend) --outbound <https prefix>(repeatable)outboundURL prefixes a run may send requests under (Call an external service) --upgrades owner|publisherupgradeswho upgrades the package’s instances; absent means owner--guests allowed|forbiddenguestswhether an instance’s listed accounts reach it without joining its organization; absent means forbidden(Guests)--instance-org standalone|org|eitherinstanceOrgwhich organization an instance is created in: one made with it, one its creator is in, or either; absent means either(Where an instance goes)packchecks each against the node’s own rules before signing.lineage, from[package.metadata.calimero]only, pins the release’s instances: withlineage = "pinned", an instance created from it moves only to later releases of the same package, signed by the same key, whoever upgrades it, the operator included (Pinned instances). Absent meansfree. A pinning release names a semver version, and a node installs one only from cluster version 1.0.0-rc.39. A release signed with the development key pins its instances to a key everyone holds; only a node that takes development releases (--allow-unsigned-bundles) installs one, so such a pin is for local testing only.One more comes only from the crate’s
[package.metadata.calimero]:-
uses: the other apps the release calls, by the name its code knows each by. Each names the package, the semver range it works with, andmode:create(the default) is created with the app and upgraded with it,attachis an app the deployer already runs. Acalimero.lockbesideCargo.tomlpins each to a release inside its range and to that release’s ABI digest;packwrites both into the manifest and checks the vendored ABI (calimero/abi/<name>.json) against the digest. Without a lock the references are packed unpinned, with a note.[package.metadata.calimero.uses]kv = { package = "com.calimero.confidential-kv", range = "^0.1", mode = "create" }calendar = { package = "com.example.calendar", range = "^2", mode = "attach", methods = ["listEvents", "createEvent"] }methodslists what the release calls on that app as the person its run serves, once that person grants it (As the person); without it the release calls the app as itself.packchecks each against the vendored ABI.A node refuses a release whose references break the rules (
400 BAD_USES: namesa-z0-9_, at most 16, not its own package, a semver range, a locked version inside it, an ABI digestsha256:<hex>, at most 64 distinct method names, none of the node’s own__). It lists them on the release’s capability card, and an upgrade’s consent page names the apps the new release starts using or uses differently.Creating an instance of a release with
createreferences first creates each of them: in the same organization, by the same owner, from the release its lock pinned (else the newest installed one inside its range), among the installed releases the creator may use, those signed by the same key as the instance’s own package, and, for an instance from a deployment, those the same deployment offers; a package with none answers409 USES_NOT_INSTALLED, as for a package that is not installed at all, named<instance>.<name>. The instance’s record names them (links), the create answers them, and aninitthat takes alinksparameter is told their ids:#[app::init]pub fn init(links: Option<BTreeMap<String, String>>) -> app::Result<Self> { .. }linksininitArgsis the node’s; a client that sends it is refused.attachreferences are never created.The instance and its members are one unit. An instance created from a deployment’s offer gives each member the same deployment, which need not offer the member’s release when the same key signed it (the instance’s offer covers the unit): every member’s usage is billed to the deployment’s developer, and the deployment’s secret values fill what the member’s own release declares, as they do the instance’s. Deleting the instance deletes every member with it, down to the members’ own members (
DELETE /apps/{app}answers them inmembers), and a member is not deleted alone while its instance stands (409 UNIT_MEMBER). Both wait for every node to run 1.0.0-rc.32 (409 FEATURE_NOT_ACTIVE).The two modes side by side: a
createmember is part of its instance’s unit, anattachlink points at an app that stays its owner’s own.The owner attaches an app they already run to an
attachreference withPUT /apps/{app}/links/{name} { app }(whoever manages both apps, in one organization, with a passkey;DELETEdetaches it). The app must run the reference’s package (409 WRONG_PACKAGE); one outside the range is attached anyway, answeredinRange: false, and an upgrade’s consent page warns when the new release takes an attached app in another range: an attached app lives on its own and is never upgraded with the instance. Deleting the attached app detaches it.GET /apps/{app}/linkslists every reference of the release the app runs with the app linked under it, the release that app runs andinRange. The app’s code reads a link at any time, not only ininit:let kv = env::linked("kv").ok_or_else(|| Error::NoKv.into())?;A member names the instance that created it with
env::unit_of()(Nonefor an app created on its own): Confidential KV and Private Inference releases takeapp:<env::unit_of()>as their admin, so the instance uses them with no grant step.A unit upgrades in one consent: an app’s frontend asks the node’s consent page with
upgradeUnit { app, toVersion }(every app’s sheet on one page), or a client callsPOST /apps/{app}/upgrade-unit { version }(meroctland the clients:upgrade_unit) moves the instance toversionand each member to the release the new one pins for it (else the newest installed one in range), with one passkey assertion over the instance, its version and every member’s target. It answers an upgrade run, followed withGET /orgs/{org}/upgrades/{run}. A member is not moved on its own off the range its instance takes it with (409 OUTSIDE_UNIT_RANGE), and a new release that creates a member the instance does not have is refused: a unit gains members only when it is created.
A package of several services (each app instance runs one of them, named by
meroctl instance create --service NAME) gives each with--service NAME=PATH, where PATH is the service’s crate directory (built) or its component; the manifest then declaresservicesinstead ofwasm:Terminal window meroctl app pack --service directory=crates/directory --service room=crates/room \--package com.example.rooms --app-version 1.0.0 --key my-signing-key.jsonOr list them in the crate’s table, paths relative to it, and
meroctl app pack DIRpacks them with no flags (--servicereplaces the list). A workspace root with no[package]of its own is read from[workspace.metadata.calimero], its release from[workspace.package] version, and its services build into one target directory:[workspace.metadata.calimero]package = "com.example.rooms"services = [{ name = "directory", path = "crates/directory" },{ name = "room", path = "crates/room" },]Each service is packed as
services/<name>.wasm, with its compute component (built from its crate, or--service-compute NAME=FILEbeside a component) asservices/<name>.compute.wasmand its pipelines (--service-pipeline NAME=FILE) underservices/<name>/pipelines/. A name is 1 to 64 letters, digits,-or_.--wasm,--computeand--pipelinepack one service and are refused beside services.An app with compute methods also builds a compute component (
meroctl app build <crate> --out app.wasm --compute-out compute.wasm). Pass it with--compute compute.wasm: the manifest then declares it ascompute, and the.mpkcarries it ascompute.wasm. Without it a release cannot run compute, and neither can a raw.wasmupload.--computewithout--wasmpacks a package with only a compute component.A release may also ship pipelines over its compute methods:
--pipeline daily.yaml(repeatable) packs each file aspipelines/<name>, and the manifest lists it underpipelines(at most 16 per package, each at most 64 KiB), signed with the rest. The node compiles each file at install and checks it against the package’s own compute methods and the cluster’s pools: the module isself(or left out) or another installed package by its exact name, optionally pinned (module: com.acme.pdf@0.1.0; without a version, the newest release the installer may pin). That package must ship a compute component; its methods and caps are the ones the step is checked against. A module is pinned only from a release the installer may use that is public or the operator’s, signed by the package’s own signer, or, for a release installed private, private to every organization the release is for; anything else, or a module with no compute component, isUNKNOWN_MODULE. An install of the same release again (for another organization, or public) keeps its pins and is refused the same way when a pin no longer meets that rule, so it never widens who runs a private module. The release keeps running the module release it was installed against until the pipeline’s own package is released again. The module’s package cannot be uninstalled while such a release exists (409 MODULE_IN_USE). The step’s files, payer and usage stay the calling app’s. Every method must be one its module declares, and each step’s limits may only lower the method’s caps. A problem is400 BAD_PIPELINEwithdetails, a list of{file, path, code, message}for every error. A release with pipelines installs only once every node runs this release (409 CLUSTER_NOT_UPGRADED).meroctl package pipelines PACKAGEprints what a version registered.A release may ship only pipelines:
meroctl app pack --pipeline daily.yamlwith no--wasm,--computeor DIR. It has noselfmodule, so every step names a module (MISSING_MODULEotherwise), and its apps only run those pipelines.A release may also ship recipes: pipeline files kept for others to start from.
--recipe daily.yaml(repeatable) packs each file asrecipes/<name>.yaml, and the manifest lists it underrecipes(at most 32 per package, each at most 64 KiB), signed and digest-checked like every artifact. The node never compiles or resolves a recipe at install, so one may name modules that are not installed; a recipe that is not UTF-8 text, or whose bytes differ from the signed hash, refuses the release.GET /packages/{package}/{version}/recipesanswers each recipe’shashandsourceby name, from a listing the node keeps at install. A node before recipes verifies the manifest (the signature coversrecipes) and ignores the field. -
-
Install it.
A real cluster installs releases from its operator’s registry (
POST /packages/install { package, version }); publish the.mpkthere withmeroctl app publish dist/com.example.my-app-1.0.0.mpk: it pushes to the app registry (--registry) with the registry’s API key (--api-keyorCALIMERO_REGISTRY_API_KEY), or with--org ORGas a Calimero Cloud organization, whose API key it trades for a publish token. A new package is private unless--publiclists it. A public registry refuses a dev-signed bundle. A development cluster (merod --dev, andmerod local, whichmeroctl local upstarts) also takes an upload:Terminal window meroctl package install --path dist/com.example.my-app-1.0.0.mpkmeroctl instance create --name my-app --package com.example.my-app --alias my-appBefore it logs the install, the node checks the publisher’s signature and every artifact’s digest,
minRuntimeVersion, the package’s pinned signer (the first release’s), and that each component prepares and imports only what thecalimero:appworld offers. Installing is what produces an installed package: the manifest’spackageandsignerIdfix its identity. A WASM that a release of another signer’s package already ships is refused (409).
Connectors
Section titled “Connectors”A connector is a crate an app compiles in to reach one external service, such as
calimero-connector-nearai for NEAR AI Cloud.
It declares the prefixes it sends under and the credentials it needs in its own Cargo.toml, in the shape an app’s outbound and secrets take (Outbound requests):
[package.metadata.calimero.connector]outbound = ["https://cloud-api.near.ai/v1/chat/completions"]
[package.metadata.calimero.connector.secrets.NEAR_AI_API_KEY]host = "cloud-api.near.ai"paths = ["/v1/chat/completions"]header = "authorization"format = "Bearer {}"description = "NEAR AI Cloud API key"required = truestream = { text = "/choices/0/delta/content" }An app that depends on it opts in by name:
[package.metadata.calimero]connectors = ["calimero-connector-nearai"]meroctl app pack DIR finds each listed name among the crate’s normal dependencies for wasm32-wasip2 (cargo metadata) and adds its outbound prefixes and secrets to the app’s own, printing each one it adds and the crate it came from.
The signed manifest carries them as if the app had written them, so a node and the consent page see an ordinary release.
pack refuses a listed name that is not such a dependency, a dependency with no connector table, and a secret two declarations (the app and a connector, or two connectors) bind differently; the same binding twice is kept once.
A dependency the app does not list adds nothing, whatever it declares.
The merged secrets are then checked as the app’s own are.
How to use one from an action, and how to write one, is in Connectors.
Check a release before you ship it
Section titled “Check a release before you ship it”meroctl app check says what the people running your app will see when this
release replaces the last one, with the same classifier the node uses for the
upgrade sheet (calimero_bundle::update):
meroctl app check --mpk release.mpk --against last.mpkcom.acme.notes 1.3.0 → 1.4.0 Data can go to: https://inference.near.ai/v1/ Users on automatic updates: wait for an owner's or admin's approval (green, but the app or the apps it created can send data out; only an update whose unit sends nothing out applies on its own) New methods: pin, unpin · removed: none · state version unchanged (1) Egress added: none · removed: none Signer: did:key:z6Mk… (unchanged)The first line after the versions lists every destination outside Calimero the
release and the apps it creates may send data to, or says Data: stays in Calimero when there is none. Any destination outside Calimero is just a
destination: the platform never vouches for an external endpoint, a TEE
included. If your app trusts one (a private-inference service, say), verify its
attestation in your own code; it is still listed.
The next line says what an organization that lets updates apply on their own
(autoApply: noDestinations, Updates that apply on their
own) would see: only a
green release of an app whose unit sends nothing out, before or after, that
removes no method and moves none of the apps the release creates, applies on its
own, after the hold. A green release that can send data out, removes a method or
moves the apps the release creates still waits for an owner’s or admin’s
approval: an update on its own moves the app alone, so an owner or admin moves
the unit whole.
A release is red, and waits for a person’s approval, when it is signed by
another key, can send data somewhere new, declares another state version,
creates or drops an app that has egress, or newly calls another app’s methods as
the person; each reason is listed. --against VERSION reads the installed
release from a node instead of a file, and the apps a release creates with
uses come from --uses-mpk FILE (or that node).
In a release workflow, run it before app publish (and before app release)
as a gate, so a destination never appears by accident: --fail-on egress
fails when egress grows, --fail-on red on any red reason, and
--allow-egress PREFIX is the pull request saying a new destination is meant.
It exits 0 when the gate passes, 1 when it fails, and 2 when it cannot
judge.
- name: What users will see run: | meroctl app check --mpk dist/release.mpk --against dist/last.mpk \ --fail-on egress # add "--allow-egress https://api.acme.com/" when the PR allows a new destinationThe signer key is the update authority
Section titled “The signer key is the update authority”For a bundle, the package’s identity is its package and its
signerId together — not the bytecode. That makes the identity
version-stable: a new release signed by the same key under the same
package keeps the same identity and is recognized as an upgrade of the
existing app.
The corollary is the rule to remember: a new signed version must use the same signer key. Sign a new release with a different key and the node sees a different identity — it is a different package, not an upgrade, and existing instances will not pick it up. Treat the signing key as the long-lived identity of your app and guard it accordingly.