From 171759b2377e6818e79d44ec40f546248584b41d Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Tue, 10 Dec 2024 14:55:37 +0530 Subject: [PATCH] feat(bootstrap): hardcode production static contact urls --- ant-bootstrap/src/contacts.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ant-bootstrap/src/contacts.rs b/ant-bootstrap/src/contacts.rs index 8e340a5746..17a08d514d 100644 --- a/ant-bootstrap/src/contacts.rs +++ b/ant-bootstrap/src/contacts.rs @@ -13,6 +13,16 @@ use reqwest::Client; use std::time::Duration; use url::Url; +const MAINNET_CONTACTS: &[&str] = &[ + "https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts", + "http://159.89.251.80/bootstrap_cache.json", + "http://159.65.210.89/bootstrap_cache.json", + "http://159.223.246.45/bootstrap_cache.json", + "http://139.59.201.153/bootstrap_cache.json", + "http://139.59.200.27/bootstrap_cache.json", + "http://139.59.198.251/bootstrap_cache.json", +]; + /// The client fetch timeout #[cfg(not(target_arch = "wasm32"))] const FETCH_TIMEOUT_SECS: u64 = 30; @@ -57,14 +67,10 @@ impl ContactsFetcher { /// Create a new struct with the mainnet endpoints pub fn with_mainnet_endpoints() -> Result { let mut fetcher = Self::new()?; - let mainnet_contact = vec![ - "https://sn-testnet.s3.eu-west-2.amazonaws.com/bootstrap_cache.json" - .parse() - .expect("Failed to parse URL"), - "https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts" - .parse() - .expect("Failed to parse URL"), - ]; + let mainnet_contact = MAINNET_CONTACTS + .iter() + .map(|url| url.parse().expect("Failed to parse static URL")) + .collect(); fetcher.endpoints = mainnet_contact; Ok(fetcher) }