From bcb0a517fbf325ee298827c37e41ec081e90f319 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 14 Apr 2026 20:08:52 +0700 Subject: [PATCH] feat(dash-spv): add fixed testnet peer IPs (68.67.122.1-29) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DNS discovery alone may not return testnet peers. Add the 29 fixed hp-masternode IPs as fallback — they're always included in testnet peer discovery alongside DNS results. Co-Authored-By: Claude Opus 4.6 (1M context) --- dash-spv/src/network/constants.rs | 33 +++++++++++++++++++++++++++++++ dash-spv/src/network/discovery.rs | 12 ++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/dash-spv/src/network/constants.rs b/dash-spv/src/network/constants.rs index 6a27c1e7d..81cc92ce4 100644 --- a/dash-spv/src/network/constants.rs +++ b/dash-spv/src/network/constants.rs @@ -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; diff --git a/dash-spv/src/network/discovery.rs b/dash-spv/src/network/discovery.rs index efa789fc5..e26f30f27 100644 --- a/dash-spv/src/network/discovery.rs +++ b/dash-spv/src/network/discovery.rs @@ -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::() { + 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 }