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 schemagetProvider(providerId)→ fetch one provider’s detailsproviderConfig→ per‑provider runtime settings
Typical flow
List providers → choose one
Read schema → validate config fields
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, andproviderConfig(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_DEPLOY → DEPLOYING → DEPLOYED → PAUSING/PAUSED → RESUMING/DEPLOYED → PENDING_DESTROY → TERMINATED.
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
API Reference → (SDK Reference section)
Concepts → Providers, Enclaves, Lifecycle
Guides → Deploy your first enclave
Last updated