Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions dash-spv/src/network/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,39 @@ pub const MAINNET_DNS_SEEDS: &[&str] = &[
// DNS seeds for Dash testnet
pub const TESTNET_DNS_SEEDS: &[&str] = &["testnet-seed.dashdot.io"];

// Fixed peer IPs for Dash testnet (hp-masternodes)
pub const TESTNET_FIXED_PEERS: &[&str] = &[
"68.67.122.1",
"68.67.122.2",
"68.67.122.3",
"68.67.122.4",
"68.67.122.5",
"68.67.122.6",
"68.67.122.7",
"68.67.122.8",
"68.67.122.9",
"68.67.122.10",
"68.67.122.11",
"68.67.122.12",
"68.67.122.13",
"68.67.122.14",
"68.67.122.15",
"68.67.122.16",
"68.67.122.17",
"68.67.122.18",
"68.67.122.19",
"68.67.122.20",
"68.67.122.21",
"68.67.122.22",
"68.67.122.23",
"68.67.122.24",
"68.67.122.25",
"68.67.122.26",
"68.67.122.27",
"68.67.122.28",
"68.67.122.29",
];

// Peer exchange
pub const MAX_ADDR_TO_SEND: usize = 1000;
pub const MAX_ADDR_TO_STORE: usize = 2000;
Expand Down
12 changes: 11 additions & 1 deletion dash-spv/src/network/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@ impl DnsDiscovery {
}
}

// For testnet, add fixed peers as fallback if DNS returned few/no results
if matches!(network, Network::Testnet) {
use super::constants::TESTNET_FIXED_PEERS;
for ip_str in TESTNET_FIXED_PEERS {
if let Ok(ip) = ip_str.parse::<IpAddr>() {
addresses.push(SocketAddr::new(ip, port));
}
}
}

// Deduplicate addresses
addresses.sort();
addresses.dedup();

tracing::info!("Discovered {} unique peer addresses from DNS seeds", addresses.len());
tracing::info!("Discovered {} unique peer addresses for {:?}", addresses.len(), network);
addresses
}

Expand Down
Loading