A minimal Gin starter for Phala Cloud / dstack.
This starter tracks the latest Go SDK from github.com/Dstack-TEE/dstack/sdk/go.
If you want to test a local SDK branch, you can temporarily add:
replace github.com/Dstack-TEE/dstack/sdk/go => ../dstack/sdk/goNo optional blockchain helper routes.
Endpoints:
GET /GET /get_quote?text=helloGET /tdx_quote?text=helloGET /get_key?key=dstackGET /envGET /healthz
Run:
go run .Adds route:
GET /ethereum?key=dstack
Run:
go get github.com/ethereum/go-ethereum@v1.16.8
go run -tags ethereum .Adds route:
GET /solana?key=dstack
Run:
go run -tags solana .go get github.com/ethereum/go-ethereum@v1.16.8
go run -tags "ethereum solana" .cd /Users/leechael/workshop/phala/phala-cloud-gin-starter
go mod tidy
go run .Default port is :8080.
Use simulator sockets:
export DSTACK_SIMULATOR_ENDPOINT=/absolute/path/to/dstack.sock
export TAPPD_SIMULATOR_ENDPOINT=/absolute/path/to/tappd.sockCore profile:
docker build -t phala-cloud-gin-starter:local .Ethereum profile:
docker build --build-arg GO_BUILD_TAGS=ethereum -t phala-cloud-gin-starter:ethereum .Solana profile:
docker build --build-arg GO_BUILD_TAGS=solana -t phala-cloud-gin-starter:solana .Both:
docker build --build-arg GO_BUILD_TAGS="ethereum solana" -t phala-cloud-gin-starter:full .Workflow publishes profile-suffixed tags:
latest-corelatest-ethereumlatest-solanalatest-fulllatest(alias of full)
For tagged releases (e.g. v0.1.0):
v0.1.0-corev0.1.0-ethereumv0.1.0-solanav0.1.0-fullv0.1.0(alias of full)
SHA tags are also published with the same suffix pattern.
This repo supports two release triggers:
-
PR comment trigger:
- Comment on a PR:
!release patch - or
!release minor - or
!release major
- Comment on a PR:
-
Manual trigger:
- Actions ->
releaseworkflow -> Run workflow - choose bump type:
patch|minor|major
- Actions ->
Release behavior:
- computes next semantic version tag:
vX.Y.Z - creates and pushes the git tag
- builds and publishes GHCR images (amd64):
${version}-core|ethereum|solana|full${version}(alias of full)latest-*andlatest(full alias)
- creates GitHub Release with generated changelog
Use docker-compose.yml for Phala Cloud custom compose deployment.