Skip to content
Merged
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
7 changes: 4 additions & 3 deletions examples/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions tests/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Loading