diff options
| author | tv <tv@krebsco.de> | 2026-11-16 21:51:45 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-16 23:07:40 +0100 |
| commit | 0aa00a855bd8d93f4ac2c04ef0fe23b846831bbc (patch) | |
| tree | 29f9e2300f144e2209ca609674dfda657db72b89 /src/lib.rs | |
| parent | 9d9292ae5570cc4be6b68cd3eda92e80893bc679 (diff) | |
continuum-party: a party's client of a federation
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.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,5 +1,7 @@ //! continuum: a replicated Automerge document, read and written by path, synchronized -//! over Mycelium, libp2p or Tor; as a library, which the node (`main.rs`) runs (`run`). +//! over Mycelium, libp2p or Tor; as a library, which the node (`main.rs`) runs (`run`), +//! and, behind the `federation` feature, a party's client (`bin/continuum-party.rs`, +//! `party`). //! //! `run` only wires things together: arguments, the starting document, the node //! (`node`), bootstrap and the HTTP server. @@ -42,6 +44,12 @@ use document::replica::Epoch; use swarm::bootstrap; use transport::Transport; +/// Runs a party's client of a federation (`continuum-party`), as its arguments say. +#[cfg(feature = "federation")] +pub async fn party() -> Result<()> { + federation::party::main().await +} + /// Runs a node, as its arguments and configuration say, until it stops. pub async fn run() -> Result<()> { logging::init(); |
