Target: heads
The node target that declares a resource's state as a Change graph, listing the head Changes that share one genesis.
Fetching schema…

Part of Stem. This page defines the heads target of a Node.

The state is the Change graph whose current heads are listed.

Fields

field

type

required

meaning

kind

literal heads

yes

Target kind tag.

heads

list of CID, at least one

yes

The head Changes, sorted by CID. Every head shares one genesis Change.

Rules

The peer walks deps from every head and requires every Change to be indexed before it applies the Node; a missing Change stashes the Node, as a Ref is stashed today. All heads must resolve to the same genesis Change; a mismatch is invalid. The resource's version is the heads sorted and joined with .. When two Node blobs for one node are concurrent and both carry heads, the peer unions the heads and removes any CID that another applied Change depends on, which is exactly how two writers' Refs merge today. A head may be a Snapshot CID when the author continued from a snapshot; the Change that follows it names the Snapshot in its deps.

Today (HM24)

A version Ref: genesisBlob plus one or more heads. The genesis is no longer repeated on the Node because the id, not the genesis, is the identity; the genesis is still what ties the Changes together.

Example

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

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

Unsubscribe anytime