Saphan StudioDocs
Reference/Commands

saphan relay

Records requests between masters — the coordinating sessions that each run a set of streams — when one master's streams cannot finish without an answer from another.

Records requests between masters — the coordinating sessions that each run a set of streams — when one master's streams cannot finish without an answer from another. A relay blocks every stream it names until the addressee answers it; saphan fleet next shows an unanswered relay as a block reason on each of those streams.

open, ack, answer and list only write and read rows in this workspace (under .saphan/relay/): they notify nobody and carry nothing to another machine. send is the one that carries: in a workspace connected to a gateway (saphan bridge init --gateway) it delivers an event the receiving installation picks up; without a gateway the event is written locally, and the command says so.

saphan relay ack

Records that the addressee has seen a relay, moving it from open to acked. The relay still blocks its streams; only an answer clears it. The --from you give must equal the relay's addressee; the name is declared, not verified, so this stops a wrong name, not a wrong person.

saphan relay ack --id <relay-id> --from <master>
flagtypedefaultwhat it does
--fromstringThe acting master's declared name; it must equal the relay's addressee and is not verified.
--idstringThe relay id; saphan relay list shows every relay with its id.

saphan relay answer

Records the addressee's answer, which clears the block on every stream the relay names at once. The --from you give must equal the relay's addressee (a declared name, not verified), and an empty answer is refused.

saphan relay answer --id <relay-id> --from <master> --answer <text>
flagtypedefaultwhat it does
--answerstringWhat the addressee says. Required and must not be empty.
--fromstringThe acting master's declared name; it must equal the relay's addressee and is not verified.
--idstringThe relay id; saphan relay list shows every relay with its id.

saphan relay list

Lists every relay in this workspace, oldest open first, with sender, addressee, blocked streams, when it was opened, how long it has been open and its state. A file in the relay directory that cannot be read as a relay is reported by name rather than skipped.

saphan relay list [--stream <slug>]
flagtypedefaultwhat it does
--streamstringShow only relays that name this stream, including answered ones.

saphan relay open

Writes a relay — who is waiting, on whom, over which streams — and prints its id for ack and answer. Every stream must already be registered, or the whole call is refused; an unanswered relay with the same sender, addressee and streams is refused as a duplicate. The sender and addressee are declared names and are not verified.

saphan relay open --from master@payments --to master@platform --streams pay-4,pay-6
saphan relay open --from <master> --to <master> --streams <slug>[,<slug>]
flagtypedefaultwhat it does
--fromstringThe master opening the relay, whose streams are waiting.
--streamsstringSliceThe streams this relay blocks, comma-separated or repeated.
--tostringThe addressee — the only name ack and answer will accept as --from; declared, not verified.
--to-machinestringThe machine the addressee is said to work on; recorded and shown, but not checked and not used to deliver anything.

saphan relay send

Writes one addressed relay event — open, seen, ack or answer — and delivers it through the workspace's gateway when one is configured. The address is checked against the seat registry before anything is written; an address that does not resolve is refused, naming which part failed and listing the addresses that would work. The sender is not a flag: it is the registered seat whose configuration directory this process's environment names, which selects a seat but does not authenticate it. A response takes its address from the event it replies to, and its sender must be among that event's recipients.

saphan relay send --event <open|seen|ack|answer> --to <direct|all-masters|role:<role>> [--to-machine <m> --to-identity <i>]
flagtypedefaultwhat it does
--blocksstringSliceThe streams this request blocks.
--bodystringThe message text, for people to read; it is never used for routing.
--conversationstringThe thread this event belongs to; for a response it is taken from --in-reply-to.
--eventstringThe event type: open, seen, ack or answer.
--in-reply-tostringThe id of the event this one responds to; the response's address is taken from it.
--measuredstringWhat was measured, for an answer that reports a reading.
--replystringWhether a reply is expected: required, optional or none.
--resolutionstringThe resolution of an answer.
--saliencestringHow prominently the event asks to be read; an unknown value is refused with the accepted list.
--tostringThe audience: direct (one seat, named with --to-machine and --to-identity), all-masters, or role:<role>. Group audiences are fixed when the event is written.
--to-identitystringThe addressee's seat identity, for --to direct; it must be seated on --to-machine.
--to-machinestringThe addressee's machine, for --to direct; it is checked against the registry.

Global options apply to every command — see Every command.

On this page