1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# Common changes
Recipes for the changes a federation makes most, each a version to propose and vote on
([`proposing-and-voting.md`](proposing-and-voting.md)), and a few a party makes by itself.
The rules are the design's ([`federation.md`](../../federation.md),
[The policy](../../federation.md#the-policy), [Keys](../../federation.md#keys),
[Nodes](../../federation.md#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):
```sh
continuum-party --node http://tv:secret@localhost:3000 next > 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:
```sh
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`](proposing-and-voting.md),
[Voting](proposing-and-voting.md#voting)).
## Taking a party out
Leave out its keys and its node list, and the rules giving it places:
```sh
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:
```sh
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:
```sh
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:
```sh
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`](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`](keys.md)):
```sh
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: the list as it counts
at the node with nodes added (`--add`) or taken off (`--remove`), or set whole
(`--set`); `nodes` alone shows it:
```sh
continuum-party --node http://tv:secret@localhost:3000 --key tv.key \
--record tv.record nodes --add continuum:77d0…
# tv's node list: continuum:5be1… continuum:77d0…
# 9b2c… taken
```
A list left empty, taking all of the party's nodes out of the swarm, is written with
`--force` only. The client checks first that the current version names the key it
signs with for the party, and says otherwise: then only a version naming the party's keys or its list
anew changes it, which a party proposes and the parties pass. 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`](keys.md)).
* **Its writes**, wherever the rules give it places
([`writing-and-reading.md`](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`](checkpoints.md)). Keep other changes
out of it: a node voting by itself backs no version naming a checkpoint that changes
more.
|