Add gossip replication between nodes

Nodes run anti-entropy over a TCP link: each advertises its version
vector, the peer replies with the log entries it lacks, and ingest is
idempotent so re-delivery and reconnect after a split both converge.
The engine is shared behind a mutex; config gains [gossip] and [[peer]].
This commit is contained in:
Jean Chevronnet 2026-07-12 07:05:07 +00:00
parent 82e41e95b2
commit d0556ebe8c
No known key found for this signature in database
7 changed files with 319 additions and 20 deletions

View file

@ -4,6 +4,24 @@ use serde::Deserialize;
pub struct Config {
pub uplink: Uplink,
pub server: Server,
// Node-to-node replication. Absent = single node, no gossip.
#[serde(default)]
pub gossip: Option<Gossip>,
#[serde(default)]
pub peer: Vec<Peer>,
}
#[derive(Debug, Deserialize, Clone)]
pub struct Gossip {
// Address to accept peer connections on. Absent = dial-only node.
pub bind: Option<String>,
// Shared secret both nodes must present.
pub secret: String,
}
#[derive(Debug, Deserialize, Clone)]
pub struct Peer {
pub addr: String,
}
#[derive(Debug, Deserialize)]