Skip to content

tkhq/tvc-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TVC App Template

A starter template for building Turnkey Verifiable Cloud (TVC) enclave applications.

This is a minimal REST server that demonstrates the structure and patterns for running an application inside a TVC enclave.

Endpoints

$ curl localhost:44020/health
{"status":"healthy"}

$ curl localhost:44020/hello_world
{"message":"hello world"}

$ curl localhost:44020/time
{"time":1741048558}

$ curl -X POST -d 'hello' localhost:44020/echo
hello

$ curl localhost:44020/metrics
# HELP tvc_http_request_duration_ms HTTP request duration in milliseconds
# TYPE tvc_http_request_duration_ms histogram
tvc_http_request_duration_ms_bucket{method="GET",path="/health",status="200",le="1"} 1
...

Development

Run tests

make -C src test

Run locally

make -C src run

Server starts on http://127.0.0.1:44020

Lint

make -C src lint

Building OCI containers

This repository uses StageX to build OCI containers. Requires Docker >= 26 with containerd:

  • Docker Desktop: Dashboard > Settings > "Use containerd for pulling and storing images"
  • Linux: add to /etc/docker/daemon.json:
    {
      "features": {
        "containerd-snapshotter": true
      }
    }

Build the container:

make out/helloworld/index.json

Project Structure

src/
  helloworld/     # REST server binary
  metrics/        # Prometheus metrics Tower middleware
  e2e/            # End-to-end tests
images/
  helloworld/     # Containerfile for OCI image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors