HTTP endpoints¶
Every HTTP route served by the three services that listen on port 5000: the backend, the event handler and the consensus committee. Method, path, body and responses.
| Service | Route | Method | Purpose |
|---|---|---|---|
| Backend | /api/SendPTB |
POST | Build, sign and submit a PTB |
| Backend | /health |
GET | Liveness |
| Backend | /ready |
GET | Readiness: coin caches warm |
| Backend | /api/SendAAPTB |
POST | Deprecated. Legacy account abstraction, only with ENABLE_AA=true |
| Event handler | /api/handle_event |
POST | Receive an event to relay |
| Committee | /api/handle_event |
POST | Receive an event to order |
| Committee | /api/status |
GET | Committee state and counters |
| Committee | /health |
GET | Liveness and quorum |
Source files: stealth_name_service/backend/testing_backend/src/main.rs (routes) and
src/server.rs (response types), src/bin/event_handler.rs, src/bin/consensus_committee.rs.
Backend (testing_backend)¶
Listens on 0.0.0.0:5000, or 0.0.0.0:8443 over TLS with ENABLE_HTTPS=true. The JSON body limit
is 67108864 bytes (8192 * 8192). Design: The backend HTTP server.
POST /api/SendPTB¶
Builds one programmable transaction from the request, signs it with the keystore key of
auth.address, submits it over gRPC and returns the execution details.
Request body (JSON):
| Field | Type | Meaning |
|---|---|---|
auth.address |
string | Sender address. Its key must be in the backend's iota.keystore. |
auth.request_number |
number | Request index. Echoed in the load-test CSV. |
auth.agent_number |
number | Agent index. Echoed in the load-test CSV. |
auth.gas_budget |
number | Gas budget for the transaction. |
ptb |
array | PTB definitions. Only the first element is used; an empty array is an error. |
ptb[].network |
string | testnet or devnet. Any other value is an error. |
ptb[].calls |
array | Move calls, appended to the PTB in order. |
calls[].target |
string | <package>::<module>::<function>. |
calls[].type_args |
array of string | Optional, default empty. Type arguments in Move notation, such as "0x2::iota::IOTA" or "u64". |
calls[].args |
array | Arguments as JSON arrays: [type, value], ["result", cmd, res], ["vector", type, elems], ["vecmap", types, entries], ["option", type, value], ["pure", type, value]. See Building PTBs from JSON and Writing a payload. |
A complete sample is stealth_name_service/backend/agent/payloads/bridge_request.json.
Responses:
| Status | Body |
|---|---|
200 |
{"transactions": [ ... ], "status_code": 200}. One transactions item per request (fields below). A Move abort is still a 200: the failure is in transactions[].status. |
500 |
{"error": "<message>", "status_code": 500}. Any error before or during submission, such as an unsupported network, an invalid sender, No gas coins available for sender <address>, or an argument that cannot be encoded. |
400 |
Actix rejects a body that is not valid JSON or does not match the request type. |
Fields of a transactions item:
| Field | Meaning |
|---|---|
digest |
Transaction digest. |
status |
Success, or Failure: <error> for an abort or other execution failure. |
gas |
Object with computation_cost, computation_cost_burned, storage_cost, storage_rebate, non_refundable_storage_fee and net_fees. Omitted when absent. |
network_type |
The ptb[].network value. |
total_time |
Seconds from the start of the request to the end of the network call. |
off_chain_time |
Seconds spent off-chain, before submission. |
pre_submission_time |
Network window minus the execute call: signing and coin lookup. |
network_latency |
Seconds for the full network window. |
blockchain_processing_time |
Seconds of the execute call alone. |
transaction_size_bytes |
Size of the submitted transaction. |
send_time_ms |
Epoch milliseconds stamped when the PTB is built, before coin lookup, signing and submission. |
checkpoint_height |
Node checkpoint height when it answered. Omitted when unknown. |
GET /health¶
Always 200 with body OK, as soon as the server is bound. The container healthcheck polls it.
GET /ready¶
200 with body READY once the coin caches are warm, 503 with body WARMING before. Gate a
load run on this route, not on /health: starting early sends every request down the RPC fallback
path. loadtest derives it from --target-url by replacing the path with /ready.
POST /api/SendAAPTB¶
Deprecated
Registered only when ENABLE_AA=true; otherwise the path returns 404. It belongs to the legacy
abstract_account path. Use Track C instead: One-time bridge setup.
Background: Legacy: the abstract_account path.
Same request body and responses as /api/SendPTB, but the transaction is authenticated by the legacy
account instead of a keystore signature.
Event handler (event_handler)¶
Listens on 0.0.0.0:5000. It has one route. The handler answers as soon as the event is queued, not
when it is executed; results go to bridge_results.csv. Design:
The event handler.
POST /api/handle_event¶
Request body: the payload event_listener posts.
| Field | Type | Meaning |
|---|---|---|
source_event_tx_digest |
string, required | Digest of the source transaction that emitted the event. |
source_event_seq |
number, required | Event index within that transaction. |
source_event_timestamp_ms |
number, optional | Source event timestamp. |
detected_at_ms |
number, optional | When the listener saw the event. |
parsed_json |
object, optional | The event's decoded fields (CrossChainRequest). Bridge mode needs it. |
consensus |
object, optional | Set by the committee on delivery: height, observed_at_ms, committed_at_ms, delivered_at_ms, reports, committee_nodes, committee_faulty, committee_byzantine, committee_strategy. |
Responses are {"status": "...", "message": "..."}.
With the committee off (CONSENSUS_ENABLED not on), anyone can post:
| Status | status / message |
When |
|---|---|---|
202 |
queued / event accepted |
The event is in the worker queue. |
429 |
overloaded / queue full, retry later |
The queue (capacity 150000) is full. |
500 |
error / worker unavailable |
The worker channel is closed. |
With the committee on, the route is the delivery gate. The body is verified byte for byte against
the x-committee-signature header, an HMAC-SHA256 under CONSENSUS_DELIVERY_KEY:
| Status | status / message |
When |
|---|---|---|
403 |
rejected / CONSENSUS_ENABLED=true: only deliveries signed by the consensus committee are executed |
The header is missing or the signature does not verify. This is the 403 rule: events posted directly to the handler, or a body changed after signing, are never executed. |
400 |
rejected / delivery body is not an event |
A signed body does not parse as an event. |
400 |
rejected / delivery has no consensus metadata |
A signed body has no consensus object. |
202 |
duplicate / already queued |
The same signed body was already queued. It is not executed twice. |
202, 429, 500 |
as above | Queueing outcome, the same as with the committee off. |
500 |
rejected / committee gate not configured |
Internal state error. |
Consensus committee (consensus_committee)¶
Listens on CONSENSUS_LISTEN_ADDR, default 0.0.0.0:5000. Design:
The consensus committee inside.
POST /api/handle_event¶
Ingest. Accepts the same payload the listener sends to the handler (source_event_tx_digest,
source_event_seq, source_event_timestamp_ms, detected_at_ms, parsed_json). It validates the
event, records that every live node observed it, queues it and replies at once; background workers
hand it to a CometBFT mempool.
| Status | status |
When |
|---|---|---|
202 |
queued |
Accepted. Includes tx, the event key in hex. |
202 |
duplicate |
Already committed, already observed, or posted twice at once. Includes tx. |
202 |
rejected |
The event is invalid (chain ids, encoding) or its source_sender is not in the destination ACL. Final: the listener must not retry it. Includes message. |
400 |
error |
The body cannot be encoded. Includes message. |
503 |
unavailable |
Crashes at runtime left the committee without a quorum. The listener holds its cursor and retries. |
503 |
overloaded |
The ingest queue (CONSENSUS_INGEST_QUEUE) is full. The listener retries. |
GET /api/status¶
Returns JSON with these top-level keys:
| Key | Contents |
|---|---|
committee |
nodes, honest, byzantine, faulty, strategy, max_tolerated, delivery_threshold, bound_exceeded, running_validators, healthy. |
acl |
enabled and senders (number of ACL entries loaded). |
ingest |
queued, in_queue, broadcast, duplicates, rejected, retries, workers. |
sink |
delivered, delivered_unobserved (forged commits), delivery_failures, evidence, last_commit_height. |
processes |
One item per CometBFT process: node, role, height, pending, rpc. |
GET /health¶
200 with body ok, or 503 with the reason once CometBFT processes that died at runtime leave
the committee without a quorum. A committee that is configured below quorum (too many faulty nodes)
stays healthy: its stall is the experiment.