# README
👉 RPC Protocol
The RPC protocol used by Hemi's daemons is WebSocket-based and uses JSON-encoded requests/responses.
The JSON data sent over WebSocket connections are referred to as "messages".
📩 Message Format
An RPC message has the following format:
{
"header": {
"command": "command-name",
"id": "request-id"
},
"payload": null
}
Header
The message header contains metadata required for processing the message:
command
: The name of the command being executed.id
: A string used to uniquely identify each request. Responses will have the sameid
as the request, making it possible to match requests to responses.
Payload
The payload type depends on the command being called. Please refer to the documentation for more details on the specific API you wish to use.
# Functions
Errorf returns a protocol Error type with an embedded trace.
NewConn returns a client side connection object.
NewInternalError returns an InternalError wrapping the given error.
NewInternalErrorf returns an InternalError constructed from the passed message and arguments.
No description provided by the author
No description provided by the author
RequestError wraps an error to create a protocol request error.
RequestErrorf creates a new protocol request error.
Write encodes and sends a payload over the API connection.
# Constants
XXX can we just hijack 4100?.
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
# Structs
Conn is a client side connection.
ConnOptions are options available for a Conn.
Error is a protocol error type that is used to provide additional error information between a server and client.
Header prefixes all websocket commands.
InternalError represents an internal application error.
Message represents a websocket message.
Ping.
PingResponse.
No description provided by the author
# Interfaces
No description provided by the author
APIConn provides an API connection.
Authenticator implements authentication between a client and a server.