summaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-25 11:43:53 +0100
committertv <tv@krebsco.de>2026-10-25 11:43:53 +0100
commit9845a07960fa083db0b0c7e2312f98706e9684cb (patch)
treec5df07227d4fbc75e817eada595cec6a819eee43 /src/config/mod.rs
parent680097c9e82d9140ca7e2421113d23cc644b0cc2 (diff)
add state fileHEADmaster
This allows storing the swarm ID and additionally discovered seeds, which prevents a formerly genesis node to start a new document.
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 73f4432..b4ea0aa 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -107,7 +107,14 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[
Kind::Flag,
"BOOL",
Some("false"),
- "Start a new swarm, as its genesis node, instead of joining one through seeds. Every start with it starts another new swarm: drop it once the swarm exists, and give the node seeds instead.",
+ "Start a new swarm, as its genesis node, instead of joining one through seeds. Every start with it starts another new swarm: drop it once the swarm exists, and give the node seeds instead. With a --state-file that remembers a swarm, it starts that swarm again instead (empty; nodes of it still running merge with this one).",
+ ),
+ option(
+ "state-file",
+ Kind::Text,
+ "PATH",
+ None,
+ "File where this node remembers its swarm across restarts: the swarm ID and some members to rejoin through (not the document). Written once ready, then rarely. Without it, a restarted node knows only its configured seeds.",
),
option(
"swarm-key-file",
@@ -222,6 +229,7 @@ pub(crate) struct Settings {
pub(crate) seeds: Vec<String>,
#[serde(default)]
pub(crate) genesis: bool,
+ pub(crate) state_file: Option<PathBuf>,
pub(crate) swarm_key_file: Option<PathBuf>,
pub(crate) alias: Option<String>,
#[serde(default = "default_keepalive_secs")]