Part of Stem. This page defines the Publish method of the sync RPC specification. Clients, the CLI and the SDK publish with it.
The formal schema is attached as the schemaDefinition of this page: a struct {key, input, output} with key pinned to Publish.
The local ingest call for clients, the CLI and the SDK. It is the same pipeline every transfer goes through: validate, authorize against the claimed scope, index, then offer to the scope's authority peers according to policy.
Input
field | type | required | meaning |
|---|---|---|---|
| list of rpc/type/blob-envelope | yes | Signed blobs to store and index, in any order. |
| no | The scope the blobs belong to. Omitted means the daemon derives it from the blobs. |
Output
field | type | required | meaning |
|---|---|---|---|
| list of cid | yes | CIDs stored and indexed. |
| list of rpc/type/rejection | yes | Blobs stored but not yet applied, with the reason. |
| list of rpc/type/rejection | yes | Blobs refused. |
Rules
Blobs are accepted in any order. Each goes through the runtime model: hash, signature, kind rules, authority against scope (derived from the blobs when omitted: a Node's space and id, a Change's genesis, a Snapshot's node via the Node that names it).
A blob whose dependency or authority is missing is stored and reported in stashed; it is applied when the missing blob arrives, in this call or a later one.
A blob that fails validation is reported in rejected and not stored. The call is not atomic: other blobs in the same call are kept.
After indexing, the daemon sends an Offer for the new blobs to every reachable authority peer of the scope's space, and to any peers the matching policy rule names. It never offers to anyone else.
Publishing records a transfer row with peer local.
Every blob is at most 2 MiB.
Today (HM24)
HM24's Daemon.StoreBlobs (and the web PublishBlobs key over it) stores a batch atomically and indexes it; the apps then call Resources.PushResourcesToPeer toward the space's site and the sites of cited documents. Stem folds the push into Publish and limits it to authority peers, so citations reach other sites through those sites' own following of the citing space rather than by unsolicited push.
Example
{"key": "Publish", "input": {"scope": {"space": {"/": {"bytes": "7QEA…"}}, "node": "bafyrein6a6wfhym6l3vfz5zfkkibj5j6wjibagi3mnbqnspuq2idw52ijb", "depth": "subtree"}, "blobs": [
{"cid": {"/": "bafy…c1"}, "data": {"/": {"bytes": "omR0eXBlZkNoYW5nZQ…"}}},
{"cid": {"/": "bafy…n1"}, "data": {"/": {"bytes": "omR0eXBlZE5vZGU…"}}}
]}}{"cids": [{"/": "bafy…c1"}, {"/": "bafy…n1"}], "stashed": [], "rejected": []}Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime