aboutsummaryrefslogtreecommitdiffstats
path: root/docs/guides/federation/voting-by-itself.md
blob: bf7a01e26b3b040b43edd1f98ea80bb656e18a90 (plain)
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
# A node voting by itself

A party may have one of its nodes vote and propose for it, by rules its operator sets,
written nowhere in the swarm: every node judges what such a node signs as any vote or
proposal. The rules are the design's ([`federation.md`](../../federation.md), Votes a
node casts by itself).

## Setting it up

```sh
continuum --store-id 6d1e… --store-party tv … \
  --store-vote-key tv.key --store-vote-record tv.record \
  --store-follow lass,makefu --store-nay-beside --store-propose-events 1000
```

* `--store-vote-key`: a key the party's version names, an OpenSSH private key file
  without a passphrase, kept on the node. One stolen there votes, and writes the party's
  key set and node list, as the party, until a version names its keys anew
  ([`keys.md`](keys.md)).
* `--store-vote-record`: the party's one record of its votes, which the node votes by
  and writes before each vote. Where there is none, the node begins one on the version
  current then, and casts nothing on that version; a party that never voted gives it one
  begun from the root instead (`continuum-party --record tv.record init tv --root
  root`), which casts on every version. A record of another store or party, the node
  doesn't take, and votes none (`Voting by itself, without its party's record: votes
  none`).

A party has one node vote by itself: two of its nodes, each voting so, can vote twice.
And it votes by hand only through that node, which keeps its one record:

```sh
continuum-party --node http://tv:secret@localhost:3000 vote 8d02… yes --through
```

or `POST /admin/events/vote` with `{"proposal": "8d02…", "yes": true}`.

## Its rules

* **Following** (`--store-follow PARTY,…`): it votes `true` on a proposal where a party
  it follows voted `true`, and `false` where one voted `false`; by default only on a
  version that only moves to a checkpoint. With `--store-follow-any`, on any version:
  that hands those parties the node's vote, its `false` among it. A party followed so by
  more than a third of the parties, with its key kept on a node, can end every proposal,
  the one naming that key anew among them.
* **Proposing checkpoints** (`--store-propose-events COUNT`, `--store-propose-every
  DURATION`): once it holds so many events beyond its checkpoint, or so long after its
  store moved there by its own clock, it proposes a version that only moves to a
  checkpoint, at the heads of what it held for a while (`--store-held-for`, ten minutes
  unless set), where nothing that can still pass is proposed on the current version,
  but a proposal it wouldn't back that nobody backs but its proposer. It backs what it
  proposes, so that the nodes following its party back it too.
* **`false` beside** (`--store-nay-beside`): where it backs a proposal that can still
  pass, it votes `false` on every other version only moving to a checkpoint, so that of
  two checkpoints proposed at once the other dies, and its backers are free.

## What it keeps to

What a party's client keeps to: one `true` at a time, never `true` and `false` on one
proposal, nothing on the version its record began on, and no `true` for a proposal that
is no version ([`proposing-and-voting.md`](proposing-and-voting.md), Voting). And, for a
version naming a checkpoint, the voters' rule: it backs one only where it changes nothing
of the current version but its number, what it changes and its checkpoint, and its heads
leave out nothing it held for a while before it was proposed
([`checkpoints.md`](checkpoints.md), Backing one). A vote by hand through it keeps to the
same.

It signs its votes on the events proposing what it votes on, and its checkpoint
proposals on its heads, so that a version event may be written on them.

## Watching it

Its log says what it signs and why it signs nothing: `Voting for its party` (with the
proposal, the vote, and whether by hand), `Proposing a checkpoint for its party`,
`Couldn't vote by itself` (with why). What it cast is in its record, and at its node
(`votes` of each proposal in `GET /events/counts`).