From 2873c25e6e89aa9a781b2feac92d8ffaf3de9e16 Mon Sep 17 00:00:00 2001 From: rustaceanrob Date: Sun, 10 May 2026 22:00:15 +0100 Subject: [PATCH 1/2] test: Remove redundant DNS query This test is a relic of when DNS was implemented within the repository. Although it is nice to know if a DNS seed is down, it should not occur in integration tests. --- tests/core.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/core.rs b/tests/core.rs index 5a61ff8..9a72663 100644 --- a/tests/core.rs +++ b/tests/core.rs @@ -724,9 +724,3 @@ async fn whitelist_only_sync() { requester.shutdown().unwrap(); rpc.stop().unwrap(); } - -#[tokio::test] -async fn dns_works() { - let hostname = bip157::lookup_host("seed.bitcoin.sipa.be").await; - assert!(!hostname.is_empty()); -} From 711541b57838a73cde3e8e991e20f5ae6fc3dd9e Mon Sep 17 00:00:00 2001 From: rustaceanrob Date: Sun, 10 May 2026 22:04:10 +0100 Subject: [PATCH 2/2] example: Make DNS query internal Demonstrates the API as a comment, similar to other features. --- examples/bitcoin.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/bitcoin.rs b/examples/bitcoin.rs index 8f4bf47..82bbe0c 100644 --- a/examples/bitcoin.rs +++ b/examples/bitcoin.rs @@ -3,7 +3,7 @@ use bip157::builder::Builder; use bip157::chain::{BlockHeaderChanges, ChainState}; -use bip157::{lookup_host, Client, Event, HeaderCheckpoint, Network, ScriptBuf}; +use bip157::{Client, Event, HeaderCheckpoint, Network, ScriptBuf}; use std::collections::HashSet; use tokio::time::Instant; @@ -19,7 +19,8 @@ async fn main() { let address = ScriptBuf::new_op_return(b"Kyoto light client"); let mut addresses = HashSet::new(); addresses.insert(address); - let seeds = lookup_host("seed.bitcoin.sipa.be").await; + // Query DNS seeds for faster peer discovery + // let seeds = lookup_host("seed.bitcoin.sipa.be").await; // Create a new node builder let builder = Builder::new(NETWORK); // Add node preferences and build the node/client @@ -31,7 +32,7 @@ async fn main() { HeaderCheckpoint::taproot_activation(), )) // Add some initial peers - .add_peers(seeds.into_iter().map(From::from)) + // .add_peers(seeds.into_iter().map(From::from)) // Connections over Tor are supported by Socks5 proxy // .socks5_proxy(bip157::Socks5Proxy::local()) // Optionally request witness data when fetching a block