diff options
Diffstat (limited to 'docs/guides/federation/writing-and-reading.md')
| -rw-r--r-- | docs/guides/federation/writing-and-reading.md | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/docs/guides/federation/writing-and-reading.md b/docs/guides/federation/writing-and-reading.md index 0e6865c..c6b27ba 100644 --- a/docs/guides/federation/writing-and-reading.md +++ b/docs/guides/federation/writing-and-reading.md @@ -1,8 +1,9 @@ # Writing and reading A party writes values at places, through its client; anyone a node lets in reads what -counts there. The rules are the design's ([`federation.md`](../../federation.md), The -policy, What counts). +counts there. The rules are the design's ([`federation.md`](../../federation.md), +[The policy](../../federation.md#the-policy), +[What counts](../../federation.md#what-counts)). ## Places @@ -32,11 +33,14 @@ object, the whole event up to 256 KiB. `null` empties the place. The client signs the write with its key (`--key`), on the heads its node shows, which are what the party read; records it (`--record`), to sign it again after a move; and puts it through the node. The node answers what became of it: `taken`, `held` (taken before), -or `waiting` for an event it builds on that the node doesn't hold yet. +`waiting` for an event it builds on that the node doesn't hold yet, or `stopped`: the +node stopped at a version it doesn't read, and holds it back +([`when-things-go-wrong.md`](when-things-go-wrong.md), +[A node stopped](when-things-go-wrong.md#a-node-stopped)). A write counts while the key that signed it is among its party's keys: those of its key set, or, while it has written none, those its version names -([`federation.md`](../../federation.md), Keys). +([`federation.md`](../../federation.md), [Keys](../../federation.md#keys)). ## What counts @@ -68,7 +72,7 @@ A node refuses what every node refuses, judged at its history, and says why (`42 the federation spells one, or past its sizes. * `it builds on …, refused` (`builtOn`): an event it builds on is refused. * `it isn't above the checkpoint's heads` (`notAbove`): signed on heads a move to a - checkpoint left behind (After a move, below). + checkpoint left behind ([After a move](#after-a-move), below). And some by what the node took before (`own`), or as its operator had it drop them (`dropped`): those are the node's alone ([`running-a-node.md`](running-a-node.md)). @@ -90,14 +94,49 @@ Votes and proposals aren't signed again: their version is behind. ## Reading +The client reads what counts as JSON, as an application holds it: a place's value, or +what lies under a path as one object, the places under it and the values within theirs, +a list's items by their index; `-r` writes a string as it is, as `jq -r` does: + +```sh +continuum-party get home/tv/motd -r +# hello +continuum-party get home/tv +# { +# "hosts": { +# "laptop": { +# "ip6": "42:0:a46e::1" +# } +# }, +# "motd": "hello" +# } +continuum-party get home/tv/hosts/laptop/ip6 -r +# 42:0:a46e::1 +``` + +Where a place lies under another's value (`home/tv/hosts` holding an object, and +`home/tv/hosts/laptop` a place of its own), the deeper place is the later word there. +Nothing counting at a path is an error. `values` shows the places themselves, each with +who writes there (`--json` as one object, by place): + +```sh +continuum-party values home/tv +# home/tv/hosts/laptop {"ip6":"42:0:a46e::1"} (tv) +# home/tv/motd "hello" (tv) +``` + `GET /events/counts` is what counts, as the node reads it now: * `version`: the current version, its `number`, its `hash`, and the version itself; -* `parties`: each party's `keys` and `nodes`, as they count; +* `parties`: each party's `keys` and `nodes`, as they count, and of those nodes what + each said it speaks and knows (`knows`: the wire versions, the newest revision; null + where the node heard nothing from it), for upgrades + ([`upgrades.md`](upgrades.md), [Moving to a revision](upgrades.md#moving-to-a-revision)); * `values`: each place holding a value, with it; * `members`: each node of the swarm, with its party, `[node, party]`; * `proposals`: the proposals on the current version, by hash, each with the events - proposing it and the votes on it ([`proposing-and-voting.md`](proposing-and-voting.md)). + proposing it, the votes on it, the parties voting `true` and `false`, and whether it + passed and whether it is dead ([`proposing-and-voting.md`](proposing-and-voting.md)). `GET /events/{id}` is an event's bytes, as its party signed them: anyone can check its signature, an SSH signature over its bytes without `sig` (namespace |
