aboutsummaryrefslogtreecommitdiffstats
path: root/docs/guides/federation/voting-by-itself.md
blob: 73e9df80e13ccf6ae99fc54b60f80cfdb36972a1 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 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](../../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`, never `false`; by default only on a version that only moves to
  a checkpoint, and only where no proposal changing more holds it back (below), as a
  checkpoint lapses it. Even so, the parties following one hand
  it their votes on checkpoints. With `--store-follow-any`, on any version: that hands
  those parties the node's `true`. A party followed so by two thirds of the parties, with
  its key kept on a node, passes what it backs. On a version changing the revision it
  follows never: vote on that one by hand ([`upgrades.md`](upgrades.md)).
* **After a move** (`--store-back-after`, ten minutes unless set): it backs, and proposes,
  no checkpoint until its store held its checkpoint, or ran, that long by its own clock,
  by itself or by hand: the parties it follows move the store once that long at most, and
  just started, it holds nothing for a while yet.
* **Proposing checkpoints** (`--store-propose-events COUNT`, `--store-propose-versions
  COUNT`, `--store-propose-every DURATION`): once it holds so many events beyond its
  checkpoint, so many versions changing more than moving to a checkpoint were written
  since it (1 unless set, 0 never), 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 it holds, no more than an event may name (64, which it merges first under a
  revision with merge events), where no proposal on the current version holds it back: one
  it would back that can still pass; one that can still pass that a third of the parties
  back, someone but its proposer among them; or one held for less than a while
  (`--store-held-for`, ten minutes unless set) whose proposer has none older on the
  version. It backs what it proposes, so that the nodes following its party back it too.
  Unless told otherwise, it proposes one after every version that changes more: after a
  close vote, one key voting twice can pass a rival version at a history from before it,
  any time later, which nodes lagging behind or joining from the root may take; a
  checkpoint above that version ends that.
* **`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](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, proposals and votes aside
([`checkpoints.md`](checkpoints.md), [Backing one](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, of a checkpoint those above
its heads, 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`).