summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 04:16:56 +0200
committertv <tv@krebsco.de>2026-10-24 04:16:56 +0200
commit5710d1a367a1914d09e0eefe6984408c95a7dd2e (patch)
tree435e85ca3ea017c52ad4055c6a810ea685a1acf5 /src/main.rs
parentb92128a93bc86908290fe3d2a9a424054857535c (diff)
sync with neighbours
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 6082e67..a688e04 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -91,6 +91,11 @@ struct Args {
#[arg(long, value_name = "SECONDS", default_value_t = 60)]
keepalive_secs: u64,
+ /// Neighbours each node keeps (at least 2). Swarms of up to this many + 1 nodes are
+ /// a full mesh; larger ones sync over several hops.
+ #[arg(long, value_name = "COUNT", default_value_t = 12)]
+ neighbours: usize,
+
/// Test hook: start on a non-genesis epoch of this generation (with a fixed dummy
/// id), to check that nodes on different epochs refuse to sync.
#[arg(long, hide = true, requires = "debug_api", value_name = "GENERATION")]
@@ -186,6 +191,8 @@ async fn main() -> Result<()> {
remake: Arc::new(remake::RemakeState::default()),
swarm_key,
run_id: uuid::Uuid::new_v4().into_bytes(),
+ neighbours_k: args.neighbours.max(2),
+ neighbours: Default::default(),
stale: Default::default(),
catch_up_source: Default::default(),
};