Skip to main content
dstack enables running containerized applications in Trusted Execution Environments (TEE). For development purposes, you can use our TEE simulator to develop and test your applications locally without TEE hardware. This guide covers setting up the simulator and using our SDKs to interact with TEE functionalities. Refer to the Hardware Requirements for release.

Prerequisites

  • Rust toolchain (for building the simulator)
  • Git
  • One of the following development environments:
    • Node.js 16+ (for JavaScript SDK)
    • Python 3.7+ (for Python SDK)
    • Go 1.16+ (for Go SDK)
    • Rust 1.70+ (for Rust SDK)

Simulator

The latest TEE simulator is available in dstack code repository. Use the following commands to build it:

Build Simulator

To use the simulator with any SDK, set the following environment variable with the absolute path:

Verifying Simulator Setup

After starting the simulator, verify the setup by checking:
  1. The socket files exist in the simulator directory:
  1. The environment variable is set correctly:

dstack API

The dstack API provides the basic abstraction of the TEE functionalities. In general, it provides the following functions:
  • Get Key: Generate a cryptographic key from the specified key path and returns it along with its certificate chain.
  • Get TDX Quote: Generate a TDX quote with report data. This can be further verified in our TEE Attestation Explorer to prove your application and data are in TEE.
  • Get TDX Information: Retrieve worker information, one example response is like
The dstack.sock is the current TEE RPC API (v0.5+). For more detailed documents, check the SDK documentation.
Note: If you’re upgrading from dstack v0.3, see the Migration Guide for breaking changes.

Programming Language Support

JavaScript

Check the latest version in dstack code repository.

Installation

Basic Usage

Python

Check the latest version in dstack code repository.

Installation

Basic Usage

Golang

Check the latest version in dstack code repository.

Installation

Basic Usage

Rust

Check the latest version in dstack code repository.

Installation

Basic Usage