Skip to content
PQWERAI Join the testnet

GhostDeploy · management API

One API for every host. Never the node RPC.

GhostDeploy Universal Node Hosting API 1.0.0 (OpenAPI 3.1.0). One daemon per host, on its own port, HTTPS with a pinned certificate and scoped tokens. It manages instances and Smartnode keys; it never returns a private key and never proxies the node's JSON-RPC.

EndpointsSDKsDownload openapi.yaml

Generated from spec/api/openapi.yaml in the GhostDeploy reference repository at commit 7d80dca (2026-11-28). GhostDeploy is a draft standard (GDS-1 0.1.0-draft) for public test network 20778: formats may still change, and the repository is not public yet.

One API daemon per host (ghostdeploy api serve), on its own port (default 8790), HTTPS with a self-signed certificate whose SHA-256 fingerprint clients pin. This API is NOT the node JSON-RPC and never proxies it. Bearer tokens gd_<id>_<secret> carry scopes (read, operate, deploy, smartnode, admin) and an optional instance list. The host stores only sha256(secret). Mutating calls are written to an audit log (token id, never the secret). Private keys are never returned by any endpoint.

Connection

Server
https://{host}:8790 (default port 8790, host default 127.0.0.1)
TLS
TLS 1.3, self-signed certificate; clients pin its SHA-256 fingerprint, printed by ghostdeploy api serve
Auth
HTTP bearer, format gd_<id>_<secret>; the host stores only the hash of the secret
Scopes
read · operate · deploy · smartnode · admin, optionally limited to listed instances and an expiry
Long operations
202 Accepted with an operation id; poll /v1/operations/{id}
Errors
unauthorized, forbidden, not_found, bad_request, conflict, safety_refused, internal

Status

Live-verified

Served on a live host; conformance GD-API-01/02 pass (401 without/invalid token, 200 with a read token, API port ≠ RPC, RPC loopback only). SDKs tested against the real server: Python 24/24, TypeScript 21/21.

From docs/STATUS.md. Licence of the specification: Apache-2.0.

Endpoints

MethodPathPurposeAuthorization
GET/v1/capabilitiesCapability discoveryno token
GET/v1/openapi.yamlThis specificationno token
GET/v1/benchmarkLatest signed hardware benchmark (scope read)read
GET/v1/profilesDeployment profiles (scope read)read
GET/v1/instancesList instances visible to the token (scope read)read
POST/v1/instancesDeploy an instance (scope deploy)deploy
GET/v1/instances/{name}Instance record (scope read)read
DELETE/v1/instances/{name}Remove services; data and signer state are kept (scope deploy)deploy
GET/v1/instances/{name}/statusHealth, sync, peers, finality, validator state (scope read)read
GET/v1/instances/{name}/eventsInstance event log, newest last (scope read)read
POST/v1/instances/{name}/actions/{action}Lifecycle action (scope operate). start-signers runs every validator safety gate first.operate
POST/v1/instances/{name}/smartnode/keygenCreate a vote key on the host (scope smartnode). Returns public data only.smartnode
POST/v1/instances/{name}/smartnode/popProof of possession + calldata for the owner's wallet (scope smartnode)smartnode
GET/v1/operations/{id}Long-running operation state (scope read)read
GET/v1/offersSigned hosting offers published by this host's operator (no auth; public by design)no token

GET /v1/capabilities

Capability discovery. Authorization: no token.

Allowed without a token so clients can discover a host before pairing; reveals no instance data.

StatusMeaningBody
200OKapplication/json Capabilities

GET /v1/openapi.yaml

This specification. Authorization: no token.

StatusMeaningBody
200OKapplication/yaml

GET /v1/benchmark

Latest signed hardware benchmark (scope read). Authorization: read.

StatusMeaningBody
200OKapplication/json Benchmark
401Errorapplication/json Error

GET /v1/profiles

Deployment profiles (scope read). Authorization: read.

StatusMeaningBody
200OKapplication/json array of object

GET /v1/instances

List instances visible to the token (scope read). Authorization: read.

StatusMeaningBody
200OKapplication/json array of Instance

POST /v1/instances

Deploy an instance (scope deploy). Authorization: deploy.

Request body (required): application/json DeployRequest

StatusMeaningBody
202Acceptedapplication/json Operation
400Errorapplication/json Error
403Errorapplication/json Error

GET /v1/instances/{name}

Instance record (scope read). Authorization: read.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$
StatusMeaningBody
200OKapplication/json Instance
404Errorapplication/json Error

DELETE /v1/instances/{name}

Remove services; data and signer state are kept (scope deploy). Authorization: deploy.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$
StatusMeaningBody
202Acceptedapplication/json Operation

GET /v1/instances/{name}/status

Health, sync, peers, finality, validator state (scope read). Authorization: read.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$
StatusMeaningBody
200OKapplication/json Status

GET /v1/instances/{name}/events

Instance event log, newest last (scope read). Authorization: read.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$
limitquerynointegerdefault 100; maximum 1000
StatusMeaningBody
200OKapplication/json array of Event

POST /v1/instances/{name}/actions/{action}

Lifecycle action (scope operate). start-signers runs every validator safety gate first.. Authorization: operate.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$
actionpathyesstringone of start, stop, restart, start-signers, backup
StatusMeaningBody
202Acceptedapplication/json Operation
409Errorapplication/json Error

POST /v1/instances/{name}/smartnode/keygen

Create a vote key on the host (scope smartnode). Returns public data only.. Authorization: smartnode.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$

Request body: application/json object {validator: string}

StatusMeaningBody
200OKapplication/json KeygenResult

POST /v1/instances/{name}/smartnode/pop

Proof of possession + calldata for the owner's wallet (scope smartnode). Authorization: smartnode.

ParameterInRequiredTypeDetails
namepathyesstringpattern ^[a-z][a-z0-9-]{1,30}$

Request body (required): application/json PopRequest

StatusMeaningBody
200OKapplication/json PopResult

GET /v1/operations/{id}

Long-running operation state (scope read). Authorization: read.

ParameterInRequiredTypeDetails
idpathyesstring
StatusMeaningBody
200OKapplication/json Operation
404Errorapplication/json Error

GET /v1/offers

Signed hosting offers published by this host's operator (no auth; public by design). Authorization: no token.

StatusMeaningBody
200OKapplication/json array of object

Schemas

Error

FieldTypeRequiredDetails
errorstringyes
codestringone of unauthorized, forbidden, not_found, bad_request, conflict, safety_refused, internal

Capabilities

FieldTypeRequiredDetails
gdsstringyese.g. 0.1.0-draft
apistringyesalways gds.api/1
ghostdeploy_versionstring
host_idstringyes
hostHostFactsyes
profilesarray of object {name: string, status: string}yes
targetsarray of stringyes
networksarray of object {chain_id: integer, network: string, sequence: integer}yes
instancesinteger

HostFacts

FieldTypeRequiredDetails
osstring
archstring
cpusinteger
memory_mbinteger
disk_free_gbinteger
hostnamestring
kernelstring

Benchmark

Self-reported, signed by the host key (GDS-1 §11.3). Clients must treat it as unverified.

FieldTypeRequiredDetails
schemastringyesalways gds.benchmark/1
host_idstringyes
measured_atstring (date-time)yes
hostHostFactsyes
resultsmap of numberyes
signerstringyesed25519 public key hex
signaturestringyes

Instance

FieldTypeRequiredDetails
namestringyes
profilestringyes
targetstringyesone of compose, systemd, coolify
networkstring
chain_idintegeryes
genesis_hashstringyes
core_revstring
slotintegeryes
portsobject {p2p: integer, rpc: integer, metrics: integer}yes
signersarray of string
limitsobject
createdstring (date-time)

DeployRequest

FieldTypeRequiredDetails
namestringyespattern ^[a-z][a-z0-9-]{1,30}$
profilestringyes
chain_idintegeryesNetwork whose manifest is embedded or already accepted on the host.
targetstringone of compose, systemd, coolify; default compose
public_ipstring
etherbasestringExternal payout address for mining profiles.
memory_mbinteger
cpusnumber
artifact_urlstring

Status

FieldTypeRequiredDetails
instancestringyes
healthstringyesone of healthy, degraded, down
servicesmap of string
chain_id_okboolean
genesis_okboolean
headinteger
peersinteger
finalized_heightinteger
finalityboolean
signersarray of object {validator: string, validator_id: string, registered: boolean, status: string, last_seen_epoch: integer, fence_ok: boolean}
problemsarray of string

Operation

FieldTypeRequiredDetails
idstringyes
kindstringyes
instancestring
statestringyesone of running, succeeded, failed
startedstring (date-time)
finishedstring (date-time)
errorstring
resultany

KeygenResult

FieldTypeRequiredDetails
instancestring
validatorstring
vote_pubkeystring
validator_idstring

PopRequest

FieldTypeRequiredDetails
validatorstringyes
ownerstringyesOwner EOA address. The owner key is never sent to the host.
rotate_validator_idstring

PopResult

Public registration package for the owner's wallet (gds.smartnode-pop/1).

FieldTypeRequiredDetails
schemastring
actionstringone of register, rotate
chain_idinteger
genesis_hashstring
ownerstring
vote_pubkeystring
validator_idstring
popstring
tostring
calldatastring
value_hintstring

Event

FieldTypeRequiredDetails
timestring
kindstring
messagestring
dataobject

SDKs

Two reference clients, both of which refuse to talk to a host whose certificate does not match the pinned fingerprint and verify a Smartnode registration package before the owner signs it. Neither is published to PyPI or npm yet: install commands below apply once they are.

ClientPackageVersionRuntime
Pythonghostdeploy-client0.1.0Python 3.10+, standard library only
TypeScript@ghostdeploy/client0.1.0Node 18+, no runtime dependencies
Python client: security model, usage, tests

This is the reference client for the GhostDeploy Universal Node Hosting API, gds.api/1 (GDS-1 §10, spec/api/openapi.yaml). It uses only the standard library and needs Python 3.10+.

Security model

  • HTTPS only, with a pinned certificate. The host certificate is self-signed. You pin the SHA-256 of its DER bytes, which ghostdeploy api serve prints at start.
  • The client compares the fingerprint in constant time right after the TLS handshake, before anything is sent, including the bearer token.
  • On a mismatch it raises FingerprintMismatch.
  • You cannot construct a client without a fingerprint. The check cannot be turned off, and there is no fallback to unverified TLS. Environment proxies are ignored.
  • Bearer tokens. Tokens have the form gd_<id>_<secret>. They are sent only in the Authorization header and never appear in repr().
  • Errors. Every server error raises an APIError subclass that carries .status and .code. The codes are unauthorized, forbidden, not_found, bad_request, conflict, safety_refused, internal, and the reference server's rate_limited. The subclasses are Unauthorized, Forbidden, NotFound, BadRequest, Conflict, SafetyRefused, RateLimited and InternalError. A 429 response is retried a few times with backoff.
  • No secret material. No method sends or receives secret key material. Keygen returns public data only, and the PoP request carries only the owner address.

Usage

from ghostdeploy_client import Client, verify_pop

c = Client("https://203.0.113.10:8790", fingerprint="57dc07ba...dd3", token="gd_<id>_<secret>")
c.capabilities()                      # works without a token
c.list_instances(); c.get_instance("alice"); c.status("alice"); c.events("alice", limit=50)
c.profiles(); c.benchmark(); c.offers(); c.openapi()

op = c.stop("alice")                  # also start / restart / start_signers / backup, or c.action(name, action)
c.wait_operation(op, timeout=300)     # raises OperationFailed / OperationTimeout

c.deploy("carol", "cold-smartnode", 20778, target="compose")
c.delete_instance("carol")

kg = c.smartnode_keygen("alice", "v1")
pkg = c.smartnode_pop("alice", "v1", owner="0xYourOwnerAddress")
verify_pop(pkg, expected_owner="0xYourOwnerAddress", expected_chain_id=20778)  # do this BEFORE signing

verify_pop(pop_result)

verify_pop first runs pure-Python checks (verify_pop_calldata). These always run:

  • The calldata is exactly 0x01 || RLP([vote_pubkey(32), pop(64)]). For a rotate it is 0x06 || RLP([rotated_id, vote_pubkey, pop]).
  • validator_id == sha256(vote_pubkey).
  • to is the registry 0xe52c49c93523b0bc4d53de22a0631994fbcb70e9.
  • The optional expected owner, chain and genesis match.

Then it verifies the ed25519 signature over sha256("PQAI-G4-POP-V1" || chainID[32 BE] || genesis[32] || owner[20] || vote_pubkey[32]). This step needs the optional cryptography package (pip install ghostdeploy-client[pop]). Without that package, verify_pop raises NotImplementedError, and only after the calldata checks have passed. You can then verify verify_pop_calldata(pkg)["message"] with any other ed25519 library.

Tests

cd sdk/python
python -m unittest discover -s tests -t . -v
  • tests/test_unit.py runs offline. It covers RLP and PoP against the vector captured from the released pqwerai-cli (internal/smartnode/testdata), plus client input checks.
  • tests/test_integration.py builds sdk/testserver with go build and runs the real internal/api server on 127.0.0.1, with a throwaway root and the embedded 20778 manifest. It touches no network and runs no system commands. It is skipped when Go is missing. Set GHOSTDEPLOY_GO to choose a toolchain.
TypeScript client: security model, usage, tests

This is the reference client for the GhostDeploy Universal Node Hosting API, gds.api/1 (GDS-1 §10, spec/api/openapi.yaml). It runs on Node 18+ and has no runtime dependencies. It uses only node:tls, node:http and node:crypto.

Security model

  • HTTPS only, with a pinned certificate. The client does not use https.request and does not trust any CA.
  • It opens the TLS connection itself with tls.connect.
  • On secureConnect it compares the SHA-256 of the peer's DER certificate with the pinned fingerprint, in constant time.
  • Only after the pin matches does it hand the socket to node:http (createConnection).
  • No request bytes are written before that, including the bearer token.
  • On a mismatch it throws FingerprintMismatchError. The fingerprint is mandatory and the check cannot be disabled.
  • No proxy, no shared agent. Every request gets its own freshly pinned connection.
  • Errors. Server errors throw APIError with .status and .code, which is the gds.api/1 code. A 429 response is retried with backoff.
  • PoP verification. verifyPop() always runs every check, including the ed25519 signature. Node's built-in crypto provides ed25519.

Usage

import { Client, verifyPop } from "@ghostdeploy/client";

const c = new Client({ baseUrl: "https://203.0.113.10:8790", fingerprint: "57dc07ba...dd3", token: "gd_<id>_<secret>" });
await c.capabilities();                       // works without a token
await c.listInstances(); await c.getInstance("alice"); await c.status("alice"); await c.events("alice", 50);
await c.profiles(); await c.benchmark(); await c.offers(); await c.openapi();

const op = await c.stop("alice");             // start / restart / startSigners / backup / action(name, action)
await c.waitOperation(op, { timeoutMs: 300_000 });

await c.deploy({ name: "carol", profile: "cold-smartnode", chain_id: 20778 });
await c.deleteInstance("carol");

await c.smartnodeKeygen("alice", "v1");
const pkg = await c.smartnodePop("alice", "v1", "0xYourOwnerAddress");
verifyPop(pkg, { expectedOwner: "0xYourOwnerAddress", expectedChainId: 20778 }); // BEFORE signing

verifyPop checks the following:

  • The calldata is exactly 0x01 || RLP([vote_pubkey, pop]). For a rotate it is 0x06 || RLP([rotated_id, vote_pubkey, pop]).
  • validator_id == sha256(vote_pubkey).
  • to is the Smartnode registry.
  • The optional owner, chain and genesis expectations match.
  • The ed25519 signature over sha256("PQAI-G4-POP-V1" || chainID[32] || genesis[32] || owner[20] || key[32]) is valid.

Build and test

cd sdk/typescript
npm install          # dev only: typescript + @types/node
npm test             # tsc, then node --test on dist/test/*.test.js
npm run test:src     # Node 22.18+/23.6+: run the .ts sources directly (type stripping), no build step

The sources use only erasable TypeScript syntax and import with .ts extensions. rewriteRelativeImportExtensions turns those imports into .js in dist/.

test/integration.test.ts builds sdk/testserver with go build and runs the real internal/api server on 127.0.0.1, with a throwaway root and the embedded 20778 manifest. It touches no network and runs no system commands. It is skipped when Go is missing. Set GHOSTDEPLOY_GO to choose a toolchain.