Skip to main content

gRPC Protocol Reference

The WatchTower agent communicates via a single bidirectional gRPC streaming RPC.
If you’re using the Kotlin SDK, you don’t need to implement the protocol directly.

Service

service TerminalAgent {
  rpc Connect(stream AgentMessage) returns (stream PlatformCommand);
}

Agent → Platform

MessageFieldsDescription
Heartbeatlat, lng, battery_pct, signal_strength, uptime_secsTerminal health check (every 30s)
TransactionEventid, type, amount, currency, status, reference, response_code, metadataPayment transaction report
StatusChangeold_status, new_status, reasonTerminal state transition

Platform → Agent

MessageFieldsDescription
BlockCommandreason, block_type (“soft”/“hard”)Disable transaction processing
UnblockCommandreasonResume processing
ConfigUpdateheartbeat_interval_secs, gps_interval_secsRemote config change
Ping(empty)Keep-alive

Authentication

The first AgentMessage must include terminal_id (serial number) and api_key. The server validates the key and resolves the serial number to a terminal UUID. Stream terminates if auth fails.

Full Protocol Definition

See the complete .proto file: backend/proto/agent/v1/agent.proto