aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/bootstrap.rs
Commit message (Collapse)AuthorAgeFilesLines
* bootstrap: a node ready at once tries its seeds until they resolvetv20 hours1-2/+27
| | | | | | | | | A node starting from a document, or as a swarm's genesis node, is ready at once, and says HELLO to its seeds, members of its swarm that may be running. A seed that didn't resolve then (the node, or the seed, not reachable yet) was tried no more, and a node whose document names no member to reach, as one started from a store's root, stayed alone. Now such seeds are tried again in the background, backing off as a joining node does, until they resolve or the node stops.
* federation: a fork's root made, and checked by a node holding its historytv21 hours1-14/+3
| | | | | | | | | | `federation::fork`: a node holding a federation's history makes the root of a fork at heads it holds by a version, with the events the root keeps, as the file the fork's founders start its swarm from (`make`, `root_file`, which `--store-root` reads); and checks a fork's root it is given (`check`): whether it builds that root at its heads, byte for byte, what it holds that those heads lack, and, party by party, the keys the fork's version gives where they aren't those the party had there. The attack rows 35 and 36 have their tests.
* node: `--store-root` holding a fork's root and the events it keepstv21 hours1-11/+56
| | | | | | | The file `--store-root` names holds the store's root on its first line, and, for a fork, the events the root keeps, each on a line of its own (JCS writes no line break). The node checks that the federation takes them as a store's root with what it keeps, and starts from the changes founding the swarm, built from them.
* document: the changes founding a fork's swarm, built from its root and what ↵tv21 hours1-1/+1
| | | | | | | | | | | it keeps A fork's root keeps events (`docs/store.md`, On Automerge): they follow its genesis change in changes of the same writer, built the same way, filled in the order of their IDs, events going into a change until their bytes there reach 1 MiB, the next event beginning the next change (`events::founding`). A swarm holding a store starts from all of them (`events::started`, given the events the root keeps; none for a federation's root).
* node: a swarm holding a store, started from its root or joined by its IDtv25 hours1-0/+124
| | | | | | | | | | | | | | | | | | | | Behind the `federation` feature, two options: * `--store-root PATH` starts a swarm holding a store, or goes on with one, from the store's root, as bytes in the file, which the federation must take as a root. With no document to start on, the node builds the genesis change from it, as every node given the root does, and is ready at once; a document to start on must be of the root's swarm. * `--store-id ID` joins one through seeds by its ID, the root's SHA-256 in hex. An empty document of the first epoch takes as its root only that store's genesis change, built again from the root it holds (`document::events::is_genesis`), whatever peers name: the root pin doesn't wait for seeds, nor is disputed. Either names the swarm the node joins, which a state file must remember too, and can't be combined with the other, nor with what makes a new swarm's first change (`--genesis`, `--bootstrap-users`, `--bootstrap-keys`, `--bootstrap-policy`, `--remake`, `--genesis-root`). The root is read as a file of its own kind (`store`), counted among the node's files.
* swarm: a new swarm's policy recorded in its genesis changetv2 days1-1/+6
| | | | | | | | | | | | | | | | A swarm strict from its start had its policy written by its first user in a later change. A change is judged by the policy at its history, so any member could always add a change whose history is from before the policy: judged by none, needing no signature, taken whenever it comes. Since signed values are read by `seq`, an envelope planted there with the highest `seq` there is can never be followed: a ban, a user, a declaration, for good. `--bootstrap-policy JSON`, with `--genesis`, records the policy in the genesis change, with the first users: then no change of the swarm is from before it. It must be a policy this node knows, and a strict one needs `--bootstrap-keys`, or nobody could sign what decides who may do what.
* document file: a clean stop marked, and `--keep-actor` writes on as the same ↵tv8 days1-2/+8
| | | | | | | | | | | | | | | | | | | | | | actor A node writes as a fresh Automerge actor at each start, so no change number of an actor comes twice: one sent before a crash but not yet appended to the document file would otherwise be made again, differently. An epoch thus gathers a writer per start, and every transfer of its history carries a signature per writer. The document file now says when it holds everything the node wrote: * at a clean stop, after the last append, an empty `Closed` record, only where the file is up to the document's heads (ready, not rejoining); * as a node starts on the file, before anything is written, an empty `Opened` record, so a crash from then on leaves a file without the mark; * the header names the actor the node writes with (`current`). With `--keep-actor` (off by default; needs `--document-file`), a node starting on a file that ends with `Closed` writes on as that actor. A crash, a drop, a switch or a rejoin still starts a fresh one, so an epoch's writers come to one per node plus one per such event. lifecycle.md says so.
* roots: only the seeds' roots end the wait for themtv8 days1-0/+1
| | | | | | | | | | | | | | Review 4, R2 partly (F8): a joining node waited for "each of its seeds" to name the swarm's root as a count, of every admitted peer that named one. Node identities are self-made and admission is the swarm key: a member answering a joiner under as many identities as it has seeds, naming its own root within the wait, made the joiner pin it before the real seeds answered, and refuse them after as another history. Now the seeds are the nodes proven at the seeds' addresses (`roots::seed_found`, as `bootstrap::resolve_seeds` finds them), and only their roots count toward the wait and start its clock. Another peer naming a root still disputes it (no root while they differ), so such a member can keep a joiner from joining, as any member can, but not hand it another root. access.md says so.
* roots: a joiner takes a root once its seeds named ittv9 days1-1/+19
| | | | | | | | | | | | | | | | Review 3, R2: the root pin was set by the first HELLO_REPLY, and the first sync, a round trip later, took that root; a peer naming another afterwards was refused as another history. So the seed that answered first decided, not "none while they disagree", and a malicious seed makes itself fastest. A node joining with an empty document of the first epoch now takes no root (RootPin::Awaiting, roots left for later) until each of its seeds named one, or ROOT_WAIT (10 s) passed since the first did; then the one they name, none while they differ, as before. With --genesis-root it takes that one alone, at once. access.md, the option's help and example.toml say so; switching roots later, while the joiner holds nothing of its own, is postponed.
* roots: an epoch's root pinned, and named in every handshaketv9 days1-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Review 2, N7, the care it raised: a joining node's empty document took as the first epoch's root whatever dependency-less change came first, from whichever peer it joined through; the first epoch's ID is all zeros, so nothing pinned it. A remake's epoch has its ID, the snapshot change's hash, which the rules hold its root to. * Every node names its epoch's root in HELLO and HELLO_REPLY (the epoch's ID for a remake's, its genesis change for the first; wire version 45). A node whose document starts from another root of the same epoch refuses the handshake, logging it: another history under the swarm's ID, a forged root or a genesis started again. * A joining node with an empty document takes as its root only the one it was given (--genesis-root, new), else the one its peers name, and none while they name different ones (access::screen::RootPin, kept in Screening across documents): one peer hands it another root only if it is all the joiner hears, or never, with --genesis-root. A root refused is listed with the refused, what builds on it with it. * The genesis node logs the root (`The swarm's root`); GET /admin/epochs shows it (`root`). A genesis started again under a remembered swarm ID used to merge with the nodes of it still running; they now refuse it (another root), and the docs say to join them with seeds instead. The epoch's identity stays as it is (generation 0 all zeros): records and epoch metadata name it so, and every comparison of epochs with them.
* access: --bootstrap-keystv10 days1-5/+6
| | | | | | | The first users' SSH keys, recorded at genesis with their entries, so a swarm can be strict from its start. Auth plan M7.
* signatures: kept in the document filetv10 days1-4/+13
| | | | | | | A node's signatures are saved with its document (--document-file) and loaded with it. Auth plan M5.
* access: the users endpointstv10 days1-3/+3
| | | | | | | | /admin/users: list, add (one or several), remove, disable, grant and revoke capabilities; each one change, refused if it would lock its writer out. Capabilities as the store's paths name them. Auth plan M1.
* access: first users at genesistv10 days1-1/+23
| | | | | | | | --bootstrap-users gives a new swarm a registry from its first change, each first user with everything; other users may do nothing until added. Without it the swarm has no registry and works as before. Auth plan M1.
* HyParView (slim)tv11 days1-1/+10
|
* swarm neighbourstv12 days1-2/+10
|
* bootstrap: replace pull by progress notifytv2026-11-011-2/+14
|
* use Automerge as Document instead of AutoCommittv2026-10-311-3/+2
| | | | This allows a lot of operations to drop mut.
* move all automerge references to documenttv2026-10-311-4/+2
|
* rename AutoMerge to Documenttv2026-10-311-6/+6
|
* move keepalive and firewall to pathstv2026-10-281-0/+1
|
* use libp2p mDNStv2026-10-271-0/+11
|
* move protocol paths to dedicated moduletv2026-10-261-2/+3
|
* add simulation testtv2026-10-251-1/+4
|
* allow to persist documenttv2026-10-251-22/+145
|
* add files module to consistently track statstv2026-10-251-6/+6
|
* warn about unresolvable seeds once; log successtv2026-10-251-7/+22
|
* add disk I/O statstv2026-10-251-4/+18
|
* add possibility to start with a documenttv2026-10-251-4/+61
| | | | The --recover-from option allows a node start with a given document.
* add state filetv2026-10-251-2/+18
| | | | | This allows storing the swarm ID and additionally discovered seeds, which prevents a formerly genesis node to start a new document.
* put swarm ID into the documenttv2026-10-251-3/+19
|
* add genesis flag and never give uptv2026-10-251-65/+87
| | | | | | | | | The --genesis flag has been introduced to start with a new document. This prevents restarts to accidentally start with a new document and accept reads/writes, causing a second swarm to appear. Additionally, bootstrapping doesn't timeout anymore as that's of no use for nobody.
* drop pre-membership sync messagestv2026-10-231-4/+2
| | | | | The handshake resets the session anyway, and the sender's reply timeout resends what still matters.
* merge membership and authenticate into standingtv2026-10-231-5/+2
|
* consistently use the words node, peer, and seedtv2026-10-231-3/+3
|
* rename cluster to swarm everywhere!tv2026-10-211-14/+14
|
* rename compaction to remaketv2026-10-211-1/+1
|
* reorganize all the modulestv2026-10-211-0/+104