Concepts

A quick mental model for how Treza works with the SDK. Keep this open as you build.

Providers

What they are: Backends capable of running secure enclaves (e.g., AWS Nitro, GCP, Azure). Providers expose supported regions and a config schema (e.g., dockerImage, cpuCount, memoryMiB).

Why it matters: Each provider has different runtime/limits and regions. You pick one and pass a provider‑specific providerConfig when creating an enclave.

Key objects & calls

  • getProviders() → list available providers, regions, and config schema

  • getProvider(providerId) → fetch one provider’s details

  • providerConfig → per‑provider runtime settings

Typical flow

  1. List providers → choose one

  2. Read schema → validate config fields

  3. Create enclave with providerId + providerConfig


Enclaves

What they are: Isolated, attested compute environments that run your container image privately.

Core ideas

  • Creation: you provide providerId, region, and providerConfig (e.g., image + resources).

  • Ownership: resources are scoped to a wallet address.

  • Integration: optionally link a GitHub repo/branch for your app code and CI workflows.

Key objects & calls

  • createEnclave() / getEnclave() / updateEnclave() / deleteEnclave()

  • GitHub link via updateEnclave({ githubConnection: ... })

  • Logs via getEnclaveLogs(enclaveId, logType, limit)

What runs inside

  • Your Docker image (from Docker Hub or private registry) + environment variables you pass via your own mechanisms.


Lifecycle

What it is: Operational state machine for enclaves.

Common states (illustrative): PENDING_DEPLOYDEPLOYINGDEPLOYEDPAUSING/PAUSEDRESUMING/DEPLOYEDPENDING_DESTROYTERMINATED.

Actions

  • pauseEnclave(enclaveId, walletAddress)

  • resumeEnclave(enclaveId, walletAddress)

  • terminateEnclave(enclaveId, walletAddress) (irreversible)

When to use what

  • Pause: stop spend without destroying the environment

  • Resume: bring a paused service back

  • Terminate: free resources permanently

See Also


Last updated