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.
$ curl localhost:44020/health
{"status":"healthy"}
$ curl localhost:44020/hello_world
{"message":"hello world"}
$ curl localhost:44020/time
{"time":1741048558}
$ curl localhost:44020/random_app_proof
{"random_number":"12345","proof":{"public_key":"...","payload":"{\"random_number\":\"12345\"}","signature":"..."}}
$ curl -X POST \
-H 'content-type: application/json' \
-d '{"plaintext":"hello TVC world"}' \
localhost:44020/quorum_key/encrypt
{"ciphertext":"..."}
$ curl -X POST \
-H 'content-type: application/json' \
-d '{"ciphertext":"..."}' \
localhost:44020/quorum_key/decrypt
{"plaintext":"hello TVC world"}
$ 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
...make test
make run
Server starts on http://127.0.0.1:44020
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.jsoncrates/
helloworld/ # REST server binary
metrics/ # Prometheus metrics Tower middleware
e2e/ # End-to-end tests
images/
helloworld/ # Containerfile for OCI image