Skip to content

Commit

Permalink
feat(bootstrap): hardcode production static contact urls
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Dec 10, 2024
1 parent 4e3091d commit 171759b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions ant-bootstrap/src/contacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
"http://159.65.210.89/bootstrap_cache.json",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
"http://159.223.246.45/bootstrap_cache.json",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
"http://139.59.201.153/bootstrap_cache.json",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
"http://139.59.200.27/bootstrap_cache.json",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
"http://139.59.198.251/bootstrap_cache.json",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
];

/// The client fetch timeout
#[cfg(not(target_arch = "wasm32"))]
const FETCH_TIMEOUT_SECS: u64 = 30;
Expand Down Expand Up @@ -57,14 +67,10 @@ impl ContactsFetcher {
/// Create a new struct with the mainnet endpoints
pub fn with_mainnet_endpoints() -> Result<Self> {
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)
}
Expand Down

0 comments on commit 171759b

Please sign in to comment.