aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* continuum node-id needs none of a node's configurationtv12 hours1-3/+3
| | | | | | | | It was answered after the node's configuration was read and checked, which asked for htpasswd, a node key file and the rest: what a party's founders don't have yet as they ask for their nodes' IDs, and the guides tell them to run it alone. It is answered before now (config::asked_node_id).
* A node of both kinds, for a swarm to move to sets by (--store-both)tv12 hours1-11/+11
| | | | | | | | | | | | | | | | | | | With store-document, store-both has the node hold its store in the Automerge document too, and sync with nodes of either kind: * it says to each peer the kind that peer holds, and passes its set on to those that hold sets (swarm::set::holds_a_set), the Automerge document to the others; * what its set takes of the document goes on to the peers on sets (Holding::unpassed), and what its set takes of them is put into the document, as events it lacks are (Holding::lacking); * its entry in the document is put as its entry in the set (swarm::set::mirror_entry), and it reads the members of both; * without the set's file yet, its set is made of the store as it reads it of its document, with what store-file kept of its own. A simulation: two nodes on the Automerge document, one on a set, one of both between them; an event put on either side reaches all four.
* A node joins a swarm of sets with nothing but the store's IDtv15 hours1-1/+10
| | | | | | | | | | | | | Given store-id and store-document, no file yet and no root, or a checkpoint pinned (store-checkpoint), a node starts with nothing of its store (held::Begun::Start, passing::Start): it asks the members whose handshake it took for the checkpoint named by the store's ID, its root, or by the pin, then for the events that one keeps, each taken only as what its name says; begins its set from them; and is ready, catching up as any node behind. A set gives the checkpoint its store holds by its name (passing::Unit::Checkpoint). A simulation: a node given the ID alone joins two that hold a write.
* A node of a swarm holding a store, on a set of events (--store-document)tv15 hours1-2/+31
| | | | | | | | | | | | | | | | | With store-root or store-id, store-document names the file of the store's own document, a set of events: the node holds its store there and nothing in the Automerge document, syncs with nodes holding a set and no others, and goes on from the file when started again. Without a file yet it begins from the root (StoreStart::set); joining by the ID alone needs a file. What a checkpoint forgot is kept for store-keeps-forgotten (30 days). The file stands for store-file, and no checkpoint is pinned. The set is written to its file where it changed, every five seconds with the store's worker and as the node stops (Holding::save), what a checkpoint forgot longer ago let go of first. Simulations: a node behind catches up; a node goes on from its file.
* federation: a node votes false by no rule: --store-nay-beside is gonetv6 days1-1/+0
| | | | | | | | | | | | | | | | | | | A node following a party copies no false, so a followed key voting twice finds nobody to end the first of its two checkpoints. With --store-nay-beside its followers cast that false by rule: it showed each checkpoint to some of them, voted false on one itself, had them end it and move to the other, and passed the first with the rest. Two checkpoint versions on one, by one key, in a federation of any size. The rule was there for two checkpoints proposed at once, which a node's wait before it proposes makes rare. Where they stay proposed, neither with two thirds, their parties end one by hand: the checkpoints guide says how (Two proposed at once). Row 59 says so, and its simulation has the one two thirds back pass, with no false cast. An option that is gone is named so, with what to do (config::GONE), on the command line and in a configuration file, where "unknown option" would leave an operator guessing.
* keep-actor by default: the writer kept across a clean stop, writes held till ↵tv11 days1-3/+9
| | | | | | | | | | | | | | | | | | | a sync A node that stopped cleanly writes on as the writer of before, as `--keep-actor` had it, now by default: an epoch gathers a writer per node and per crash, drop or rejoin, not per start. `keep-actor = false`, in a configuration file, has a node write as a fresh writer each start; a node without a document file has nothing to keep, which is no longer an error. Writing on as the writer of before, a node holds its writes (`mutate_doc` and the API's through it) until it synced once with a ready neighbour, level with it, or 10 seconds passed (`AppState::hold_writes`, `KEPT_WRITER_WAIT`): a neighbour holding later changes of that writer, which a copy of the node's files made (a backup restored, a disk rolled back), hands them over first, and the node takes a fresh writer then, as it did. A node that reaches no neighbour within the wait writes on.
* federated nodes: users who read the federation alone (--store-readers)tv11 days1-0/+4
| | | | | | | | | | | | | | On a federated node, every user its htpasswd or proxy lets in may do everything: put events, have it drop what it took, vote through it with its party's key, make fork roots, read the document. An application or someone watching needn't act for the node. `--store-readers USER,...` names users who read the federation and do nothing else (`api::access::federated`, before the registry's checks): GET and HEAD of the events API (/events and below), checking a fork (POST /events/fork), and keeping a session (whoami, refresh, logout); anything else is 403, saying so. Its other users are its operators, as all were: a node setting nothing changes nothing.
* continuum node-id: a node key's ID, without starting the nodetv11 days1-0/+9
| | | | | | | | | The founders name each node by its ID in the first version, before the federation starts; getting it meant starting a node once with --node-key-create and reading its log. `continuum node-id FILE` prints the node ID of the key FILE holds and exits, `--create` making the key there first where there is none (saying so on standard error). Logs are off for it, as for --print-config: the ID goes to standard output alone.
* config: store-propose-versions is 1 unless set, in the settings tootv12 days1-1/+2
| | | | | | | | The option's help said 1 unless set, but the setting itself stayed unset, so a node proposed no checkpoint after a version unless told, and `options_and_settings_agree` failed: `default of store-propose-versions`, 1 against null. The setting is a count now, 1 unless set, and 0 has the node propose none after versions.
* vote: a checkpoint after every version that changes more, unless told otherwisetv12 days1-1/+1
| | | | | | | | | | | | | | | After a close vote, one key voting twice passes a rival version at a history from before the version that followed, the votes cast before counting with its own, any time until a checkpoint above that version: nodes that took the version refuse it, but one lagging behind, or joining from the root, may take it. A node voting by itself proposed a checkpoint after a version only where its operator set `--store-propose-versions`; now it does unless told otherwise (1 unless set; 0 never so). Versions that change more than moving to a checkpoint are rare, so the cost is a checkpoint each. A default set, store-propose-versions no longer asks for store-vote-key, as store-held-for and store-back-after don't.
* release: --version says what decides which builds work togethertv12 days1-0/+1
| | | | | | | | | | | | | | | | `continuum --version` and `continuum-party --version` say, after the release, the wire versions the build speaks, the federation and the revisions of it it knows (with the `federation` feature), and the Automerge version it makes documents with: continuum 1.0.0 wire versions 52 to 52 federation 1: the base revision, revision 1 (merge-events) automerge 0.12.0 `-V` says the release alone, as before; continuum-party had no version at all. The Automerge version is the one the crate itself reports (`document::engine_version`), so it follows Cargo.lock.
* vote: propose a checkpoint after so many versionstv12 days1-0/+1
| | | | | | | | | | | | | | The votes cast before count at a history from before too: a proposal that died, or a rival, needs there only the votes it lacked, and after a close vote one key voting twice is enough, at any time until a checkpoint above the version that followed. Nodes that took that version refuse it; one lagging behind, or joining from the root, may take it. `federation.md` said it took the keys of two thirds of the parties. A node voting by itself proposes a checkpoint once so many versions were written since its store's (`--store-propose-versions`), as the design lists: with 1, after every version, so that what keys voting twice grow beside a version ends at a checkpoint above it. `federation.md` says how little a rival version takes, row 20 too, and the guides the option.
* vote: a follower copies no false, lapses nothing others back, waits after a movetv12 days1-0/+1
| | | | | | | | | | | | | | | | | | | A node following a party (`--store-follow`) handed it more than the text said: * it copied the party's `false`: one party's nay freed bound followers, and its `true` shown to some and its `false` to the rest passed a checkpoint at one history and made it dead at another. It copies the `true` alone now, on any version too; * a checkpoint lapses every other proposal: the followed party ended any proposal it disliked by passing one. A node follows a checkpoint only where no proposal that changes more can still pass that someone but its proposer backs; * nothing bounded how often the store moved, so fresh events could be left out of every checkpoint; and a node just started held nothing for a while, so the voters' rule kept nothing. A node backs, and proposes, a checkpoint only once its store held its checkpoint, or ran, for a while (`--store-back-after`, ten minutes unless set), by itself or by hand. `federation.md` says what following hands over, and row 58 what a follower on any version copies; the guides and the example say the rest.
* federation: a rule voting `false` on a checkpoint proposed beside one a node ↵tv2026-11-171-0/+1
| | | | | | | | | | backs `--store-nay-beside`, for a node voting by itself: where its party backs a proposal on the current version that can still pass, by its record or by what it votes now, it votes `false` on every other proposal there that only moves to a checkpoint and can still pass, once. So, of two checkpoints proposed at once, the one it doesn't back dies, and its backers are free (`docs/federation.md`, Votes a node casts by itself).
* node: votes it casts by itself, for its partytv2026-11-161-1/+25
| | | | | | | | | | | | | | | | | | | | | | A node may vote and propose for its party by itself, by its operator's rules (`docs/federation.md`, Votes a node casts by itself; `federation::vote`): * `--store-vote-key`: the party's key it signs with, an OpenSSH private key file, one the party's version names, kept on the node; * `--store-vote-record`: its party's one record of its votes, which it votes by, written before each vote is sent, begun where there is none on the version current then; * `--store-follow`, `--store-follow-any`: the parties it follows, by default only on a version that only moves to a checkpoint; * `--store-propose-events`, `--store-propose-every`: when it proposes a checkpoint, once it holds so many events beyond its checkpoint, or so long after its store moved there; * `--store-held-for` (10 minutes): how long it holds an event before it holds it for a while, for the heads it proposes and the voters' rule. Its store keeps when, by the node's own clock, it took each event, and when it moved to its checkpoint. Whenever the worker reads the store, the node decides what to sign (`Holding::act`), records it, writes the record, offers it to its store, and puts it into the document (`held::write`). A vote by hand through the node, by the record and the voters' rule, is `Holding::vote_by_hand`.
* continuum-party: a party's client of a federationtv2026-11-161-1/+9
| | | | | | | | | | | | | | | | | | | | | | A second binary, behind the `federation` feature: a party's client, which signs its party's events with one of its keys (`--key`, an OpenSSH private key file), puts them through a node's API (`--node`, its user and password in the URL, or `--token`), and keeps its party's record (`--record`), by which it votes, written before a vote is sent (`federation::party`, run by `continuum::party`): * `init PARTY` begins a record of `PARTY` on the version current now; * `write PATH VALUE`, `keys KEY...`, `nodes NODE...` and `propose FILE` sign events on the node's heads, recorded, and put; * `vote PROPOSAL yes|no` votes on the proposal of that hash on the current version, by the record: with a `true`, the votes on its party's earlier proposal, from the node, checked, kept as the nays that freed it; * `again` signs again, of the latest event it signed at each place, its key set and its node list, what the node refuses as not above its checkpoint's heads, or as built on one it refuses; * `twice RECORD...` names, from the records of parties' clients, a party that voted twice. The feature brings reqwest along, the client's HTTP.
* continuum is a librarytv2026-11-161-0/+507
Everything the node is moves from the binary into a library (`src/lib.rs`), so that other binaries can use it: a party's client of a federation next. The node's binary (`src/main.rs`) runs it (`continuum::run`), which wires things together as `main` did. The library's doc comments are prose, not examples to test (`doctest = false`); its tests are the library's, as `cargo quick` and `cargo sim` run them.