summaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 4f6c5e0..4914fb6 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -131,6 +131,13 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[
"Members that renewed their alive stamp within this many days vote on remakes (a majority of them must agree). Matters on the node that coordinates a remake.",
),
option(
+ "blob-chunk-kib",
+ Kind::Integer,
+ "KIB",
+ Some("64"),
+ "Chunk size when serving large transfers to other nodes (e.g. an epoch's snapshot to a rejoining node), in KiB (1 to 4096).",
+ ),
+ option(
"mycelium-rest-url",
Kind::Text,
"SCHEME://HOSTNAME:PORT",
@@ -205,6 +212,8 @@ pub(crate) struct Settings {
pub(crate) neighbours: usize,
#[serde(default = "default_electorate_window_days")]
pub(crate) electorate_window_days: u64,
+ #[serde(default = "default_blob_chunk_kib")]
+ pub(crate) blob_chunk_kib: u32,
pub(crate) mycelium_rest_url: Option<String>,
pub(crate) mycelium_key_file: Option<PathBuf>,
pub(crate) mycelium_network_key_file: Option<PathBuf>,
@@ -227,6 +236,9 @@ fn default_neighbours() -> usize {
fn default_electorate_window_days() -> u64 {
7
}
+fn default_blob_chunk_kib() -> u32 {
+ 64
+}
fn default_mycelium_peers() -> Vec<String> {
vec!["tls://127.0.0.1:9651".to_owned()]
}
@@ -274,6 +286,9 @@ impl Settings {
if self.keepalive_secs == 0 {
bail!("keepalive-secs must be at least 1");
}
+ if !(1..=4096).contains(&self.blob_chunk_kib) {
+ bail!("blob-chunk-kib must be between 1 and 4096");
+ }
if self.electorate_window_days == 0 {
bail!("electorate-window-days must be at least 1");
}