From 9d92f3461404cb810cdfa75c4f588c207905d5a6 Mon Sep 17 00:00:00 2001 From: Yeastplume Date: Thu, 12 May 2022 13:59:34 +0100 Subject: [PATCH] visibility scope tweaks to aid seed test utilities (#3707) --- p2p/src/lib.rs | 2 +- servers/src/grin/seed.rs | 10 ++++++---- servers/src/lib.rs | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs index 52db2bece..a71e861be 100644 --- a/p2p/src/lib.rs +++ b/p2p/src/lib.rs @@ -44,7 +44,7 @@ mod peer; mod peers; mod protocol; mod serv; -mod store; +pub mod store; pub mod types; pub use crate::conn::SEND_CHANNEL_CAP; diff --git a/servers/src/grin/seed.rs b/servers/src/grin/seed.rs index 4cd845820..959653fad 100644 --- a/servers/src/grin/seed.rs +++ b/servers/src/grin/seed.rs @@ -33,8 +33,8 @@ use crate::p2p::types::PeerAddr; use crate::p2p::ChainAdapter; use crate::util::StopState; -// DNS Seeds with contact email associated -const MAINNET_DNS_SEEDS: &[&str] = &[ +/// DNS Seeds with contact email associated - Mainnet +pub const MAINNET_DNS_SEEDS: &[&str] = &[ "mainnet.seed.grin.icu", // gary.peverell@protonmail.com "mainnet.seed.713.mw", // jasper@713.mw "mainnet.seed.grin.lesceller.com", // q.lesceller@gmail.com @@ -42,7 +42,8 @@ const MAINNET_DNS_SEEDS: &[&str] = &[ "grinseed.yeastplume.org", // yeastplume@protonmail.com "mainnet-seed.grinnode.live", // info@grinnode.live ]; -const TESTNET_DNS_SEEDS: &[&str] = &[ +/// DNS Seeds with contact email associated - Testnet +pub const TESTNET_DNS_SEEDS: &[&str] = &[ "floonet.seed.grin.icu", // gary.peverell@protonmail.com "floonet.seed.713.mw", // jasper@713.mw "floonet.seed.grin.lesceller.com", // q.lesceller@gmail.com @@ -393,7 +394,8 @@ pub fn default_dns_seeds() -> Box Vec + Send> { }) } -fn resolve_dns_to_addrs(dns_records: &Vec) -> Vec { +/// Convenience function to resolve dns addresses from DNS records +pub fn resolve_dns_to_addrs(dns_records: &Vec) -> Vec { let mut addresses: Vec = vec![]; for dns in dns_records { debug!("Retrieving addresses from dns {}", dns); diff --git a/servers/src/lib.rs b/servers/src/lib.rs index 90ad6c90e..bf8c072f8 100644 --- a/servers/src/lib.rs +++ b/servers/src/lib.rs @@ -39,6 +39,8 @@ pub mod common; mod grin; mod mining; +pub use grin::seed::{resolve_dns_to_addrs, MAINNET_DNS_SEEDS, TESTNET_DNS_SEEDS}; + pub use crate::common::stats::{DiffBlock, PeerStats, ServerStats, StratumStats, WorkerStats}; pub use crate::common::types::{ServerConfig, StratumServerConfig}; pub use crate::grin::server::{Server, ServerTxPool};