aboutsummaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/mod.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index ae6070f..afd9c4e 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -216,6 +216,14 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[
None,
"Join a swarm holding a store (docs/store.md) through seeds, by its ID: its root's SHA-256, in hex. Joining with an empty document, the node takes as its root only that store's genesis change, built again from the root it holds. Can't be combined with store-root, genesis, or what makes a new swarm's first change.",
),
+ #[cfg(feature = "federation")]
+ option(
+ "store-file",
+ Kind::Text,
+ "PATH",
+ None,
+ "With store-root or store-id: where the node keeps what is its own of its store across restarts, written whenever it changes: the events it refused by what it took before (of two versions changing one, the second), and those its operator had it drop. It reads its store anew from its document whenever it starts: without the file, it may then take what it refused. A file that doesn't read stops the node from starting.",
+ ),
option(
"strict-keys",
Kind::List,
@@ -651,6 +659,8 @@ pub(crate) struct Settings {
pub(crate) store_root: Option<PathBuf>,
#[cfg(feature = "federation")]
pub(crate) store_id: Option<String>,
+ #[cfg(feature = "federation")]
+ pub(crate) store_file: Option<PathBuf>,
#[serde(default)]
pub(crate) strict_keys: Vec<String>,
@@ -1116,6 +1126,11 @@ impl Settings {
}
(Some(_), None) => "store-root",
(None, Some(_)) => "store-id",
+ (None, None) if self.store_file.is_some() => {
+ bail!(
+ "store-file keeps what is the node's own of a store: set store-root or store-id"
+ )
+ }
(None, None) => return Ok(()),
};
let first_change = [
@@ -1169,6 +1184,8 @@ impl Settings {
("store-root", self.store_root.is_some()),
#[cfg(feature = "federation")]
("store-id", self.store_id.is_some()),
+ #[cfg(feature = "federation")]
+ ("store-file", self.store_file.is_some()),
("alias", self.alias.is_some()),
("dashboard-url", self.dashboard_url.is_some()),
("debug-api", self.debug_api),