contract_id that you use when creating map ACLs.
This code goes back in quickstart.ts — the Node/TypeScript project from Quickstart — not in the z-tenant-flight Rust repo. Append it to the bottom, after the TenantClient code from Set Up Dev Env.
Before you run this code, make sure you have:
- An authenticated
TenantClientnamedtenant. If you have not created one yet, complete Quickstart and Set Up Dev Env first. - A compiled WASM file at
target/wasm32-wasip2/release/z_tenant_flight.wasm, inside the separatez-tenant-flightfolder you cloned in Write your TEE contract — not inside your Node project. - Your
tenantDid, for exampledid:t3n:abcdef0123456789abcdef0123456789abcdef01.
Choose a contract tail
Thetail is the local name of your contract inside your tenant namespace. Pass only the part after z:<tid>:. For example, the tail travel-contracts becomes:
z:<tid>: in the tail; the SDK and host derive that from the authenticated tenant.
A tail may contain letters, digits, _, -, and . — but not /. The SDK rejects slashes (tail must match /^[a-zA-Z0-9_-][a-zA-Z0-9_.-]{0,127}$/).
Pick a stable tail for each contract you plan to maintain. When you register a new build at the same tail, increase the version value; changing the tail creates a separate contract entry.
Keep tails short and simple (a few words, hyphen-separated) rather than long or descriptive. The full canonical name (
z:<tid>:<tail>) gets reused downstream in places like delegation grants, and a handful of teams have hit unexpectedly-strict length limits further down the pipeline when using long tails. The 128-character limit above is enforced at registration; treat it as a ceiling, not a target.Register the WASM
WASM_PATH above assumes you cloned z-tenant-flight as a sibling folder next to your Node project (i.e. ../z-tenant-flight/... from quickstart.ts) — if you put it somewhere else, update the path accordingly.
Registration does not run your code, create maps, seed secrets, or grant outbound HTTP access. It only stores the component and records the versioned contract entry for your tenant.
What T3N stores
The register payload is just{ tail, version, wasm }; there is no manifest.
Host-side, T3N:
- Stores the WASM blob in content-addressed storage.
- Allocates a numeric
ContractId. - Records the contract under your tenant registry.
world.wit, not from this registration request. See Capabilities come from your WIT imports.
Outbound hosts are also not declared here. They come from the calling user’s authorization grant at invoke time. See Outbound HTTP is authorized by the user, not the contract.
First-run troubleshooting
The contract is now registered. It still cannot complete the full end-to-end flow until the maps and secrets it reads at runtime exist.