exec:<command>). Device RPC is for protobuf services with a discoverable schema, audit trails, and typed request/response shapes.
Who this is for
At a glance
Core concepts
Schema
When your device connects, Golain learns which gRPC services and methods it exposes. You can list them from the management API — no manual proto upload.
Unary invoke
Call a method synchronously: POST JSON to the RPC host (
https://rpc.ilyama.golain.io) with {Service}/{Method} in the URL. Golain delivers the call to the device and returns Connect JSON.Server stream
Stream server-streaming methods over SSE: POST to
https://rpc.ilyama.golain.io/.../streams/{Service}/{Method} with Accept: text/event-stream. Each event carries a base64 protobuf message.Queued invoke
Enqueue a unary call when the device may be offline. Poll until the call succeeds. Delivery is at-least-once — design handlers to be safe on retry.
Prerequisites
Before you invoke methods from the cloud, confirm:- Device registered in the Console or via platform-tui — you need the device UUID.
- Omega with
device-rpcenabled and deployed on the device — see Omega setup. - Device online on MQTT so Golain can learn its service schema.
- Caller permission — your user needs
can_invoke_rpcon the target device.
Device RPC is separate from legacy shell RPC. Use Device RPC when you need typed protobuf services; use shell RPC for simple command execution.
Typical first-time flow
- Enable
device-rpcin Omega and deploy the device → Omega setup. - Confirm services — list available methods via the management API (for example
golain.device.v1.EchoService/Echo). - Invoke a method — POST JSON to the RPC host → Invoking methods. For server-streaming methods, use the
/streams/path. For offline-tolerant delivery, use Queued invoke. - Review audit — optional
?session_id=on invoke groups traces you can query later.
Next steps
- How it works — what happens when a device connects and when you call a method
- Omega setup — enable the module and run the echo example
- Invoking methods — curl, headers, unary invoke, and SSE streaming
- Queued invoke — offline delivery, polling, and idempotency
- API reference — management endpoints
- Troubleshooting — common errors and fixes