aboutsummaryrefslogtreecommitdiffstats

Common changes

Recipes for the changes a federation makes most, each a version to propose and vote on (proposing-and-voting.md), and a few a party makes by itself. The rules are the design's (federation.md, The policy, Keys, Nodes).

The next version

Every change below begins from the current version: the next number, the current one's hash as changes, and no checkpoint (a version names one only to move the store on, and the current version's heads are behind):

curl -s -u tv:secret localhost:3000/events/counts |
  jq '.version as $v | $v.version | .number += 1 | .changes = $v.hash | del(.checkpoint)' \
  > next.json

Each recipe is a jq filter on that file; then propose the result, and vote.

Letting a party in

Name its keys and its node list anew, since the new version's number:

jq --arg key "$(cut -d' ' -f1,2 makefu.key.pub)" --arg node continuum:e2a8… '
  .keys.makefu = {since: .number, keys: [$key]}
  | .nodes.makefu = {since: .number, nodes: [$node]}' next.json

A party let in without nodes has an empty list (nodes: []) and writes through any node that takes its events. It begins its record before it votes: from the root, as it never voted (proposing-and-voting.md, Voting).

Taking a party out

Leave out its keys and its node list, and the rules giving it places:

jq 'del(.keys.lass, .nodes.lass) | .rules |= map(select(.writer != "lass"))' next.json

What it wrote counts no more, nor its key set and node list: its nodes are members no more. To come back, the parties let it in anew.

Giving a place, taking it back

A place goes to a party by a rule before any other that matches its path; the first match decides:

jq '.rules = [{path: "names/r/wiki", writer: "lass"}] + .rules' next.json

To give it to another, change the rule's writer; to take it back, remove the rule or make its writer false. What the former writer signed there counts no more; given back later, it shows again, unless something replaced it or a checkpoint left it out.

Zones and blocks

A rule a party holds by its name gives it a zone without a vote for each name in it:

jq '.rules += [{path: "names/r/{party}", writer: "{party}"},
               {path: "names/r/{party}/**", writer: "{party}"}]' next.json

and a block of addresses by its parts, to one party:

jq '.rules += [{path: "ip4/10/243/7/*", writer: "tv"}]' next.json

Then a new host in the zone or the block is a write, no vote (designing-rules.md).

Keys named anew

A party that lost a key its version names, or had one stolen, gets its keys named anew (since the new number); every key set it wrote before counts no more, and it writes its set again (keys.md):

jq --arg key "$(cut -d' ' -f1,2 tv-new.key.pub)" '
  .keys.tv = {since: .number, keys: [$key]}' next.json

What a party does by itself

  • Its node list, signed with a key its version names, no vote:

    continuum-party --node http://tv:secret@localhost:3000 --key tv.key \
      --record tv.record nodes continuum:5be1… continuum:77d0…
    

    A version names a party's list anew only where it must: when the party is let in, or when it can't write its own.

  • Its key set, likewise (keys.md).

  • Its writes, wherever the rules give it places (writing-and-reading.md).

Moving to a checkpoint

A version that only moves the store on changes nothing else: the next version, with checkpoint set to the heads (checkpoints.md). Keep other changes out of it: a node voting by itself backs no version naming a checkpoint that changes more.