Package org.bitcoinj.net.discovery
Class DnsDiscovery
- java.lang.Object
-
- org.bitcoinj.net.discovery.MultiplexingDiscovery
-
- org.bitcoinj.net.discovery.DnsDiscovery
-
- All Implemented Interfaces:
PeerDiscovery
public class DnsDiscovery extends MultiplexingDiscovery
Supports peer discovery through DNS.
Failure to resolve individual host names will not cause an Exception to be thrown. However, if all hosts passed fail to resolve a PeerDiscoveryException will be thrown during getPeers().
DNS seeds do not attempt to enumerate every peer on the network.
MultiplexingDiscovery.getPeers(long, Duration)
will return up to 30 random peers from the set of those returned within the timeout period. If you want more peers to connect to, you need to discover them via other means (like addr broadcasts).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DnsDiscovery.DnsSeedDiscovery
Implements discovery from a single DNS host.
-
Field Summary
-
Fields inherited from class org.bitcoinj.net.discovery.MultiplexingDiscovery
netParams, seeds
-
-
Constructor Summary
Constructors Constructor Description DnsDiscovery(java.lang.String[] dnsSeeds, Network network)
Supports finding peers through DNS A records.DnsDiscovery(java.lang.String[] dnsSeeds, NetworkParameters params)
Deprecated.DnsDiscovery(Network network)
Supports finding peers through DNS A records.DnsDiscovery(NetworkParameters netParams)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.ExecutorService
createExecutor()
-
Methods inherited from class org.bitcoinj.net.discovery.MultiplexingDiscovery
forServices, forServices, forServices, forServices, getPeers, shutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bitcoinj.net.discovery.PeerDiscovery
getPeers
-
-
-
-
Constructor Detail
-
DnsDiscovery
public DnsDiscovery(Network network)
Supports finding peers through DNS A records. Community run DNS entry points will be used.- Parameters:
network
- Network to be used for port information.
-
DnsDiscovery
public DnsDiscovery(java.lang.String[] dnsSeeds, Network network)
Supports finding peers through DNS A records.- Parameters:
dnsSeeds
- Host names to be examined for seed addresses.network
- Network to be used for port information.
-
DnsDiscovery
@Deprecated public DnsDiscovery(NetworkParameters netParams)
Deprecated.
-
DnsDiscovery
@Deprecated public DnsDiscovery(java.lang.String[] dnsSeeds, NetworkParameters params)
Deprecated.
-
-
Method Detail
-
createExecutor
protected java.util.concurrent.ExecutorService createExecutor()
- Overrides:
createExecutor
in classMultiplexingDiscovery
-
-