Node target
The union of the four ways a Node blob specifies a resource's state, heads, snapshot, tombstone and redirect, discriminated by a kind tag.
Fetching schema…

Part of Stem. This page defines the node target, the field of a Node that says what the resource's state is. It is a union of four closed structs told apart by kind.

A node target is the state declaration of a resource: a set of Change heads, a Snapshot, a tombstone or a redirect.

Variants

kind

page

the state is

heads

heads

a Change graph with the listed heads

snapshot

snapshot

one Snapshot blob

tombstone

tombstone

deleted

redirect

redirect

the state of another node

Rules

A Kind declares in its state field whether its nodes use heads, snapshot or either. Every kind may use tombstone and redirect, except the space root, which may be neither deleted nor redirected. The version of a resource is derived from the target: sorted heads joined with . for heads, the Snapshot CID for snapshot, and the target node's version for a republish redirect. A tombstone and a redirect have no version of their own; the resource's history stays reachable by any earlier version. When concurrent Node blobs declare different target kinds, the state-bearing target wins over a tombstone or redirect, as the fold in Resources and nodes spells out.

Today (HM24)

The three shapes of the Ref are the same information folded into two fields: heads non-empty is a version Ref, heads empty is a tombstone, and heads empty with redirect set is a redirect that is also a tombstone unless republish is true. Stem names each case and adds snapshot, so a comment, a contact or a schema can be a resource with a single whole-state blob.

Example

{"kind": "heads", "heads": [{"/": "bafyreib3nq5mkq2w7e4w3slkz2n7m7xq6x4hw4x2x3vl6tz2cmkfnq5a3e"}]}

See also

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime