From ac7c1e4066fe98e125ac8ae12a59bbe5046bc3ae Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 28 Feb 2023 16:38:43 +0530 Subject: [PATCH] feat: read bootstrap Starchart nodes from config --- config/default.toml | 3 +++ src/settings.rs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/config/default.toml b/config/default.toml index d1e5e69..b533abf 100644 --- a/config/default.toml +++ b/config/default.toml @@ -37,5 +37,8 @@ items_per_api_call = 20 client_timeout = 60 # of HTTP client involved in crawling. In seconds. wait_before_next_api_call = 2 # in seconds +[introducer] +nodes = [] + [repository] root = "/tmp/starchart.forgeflux.org" diff --git a/src/settings.rs b/src/settings.rs index 068b0e8..b79c0d9 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -126,6 +126,11 @@ pub struct Crawler { pub wait_before_next_api_call: u64, } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Introducer { + pub nodes: Vec, +} + #[derive(Debug, Validate, Clone, PartialEq, Serialize, Deserialize)] pub struct Settings { pub log: LogLevel, @@ -138,6 +143,7 @@ pub struct Settings { #[validate(email)] pub admin_email: String, pub crawler: Crawler, + pub introducer: Introducer, } #[cfg(not(tarpaulin_include))]