public class HttpDiscovery extends java.lang.Object implements PeerDiscovery
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpDiscovery.Details |
| Constructor and Description |
|---|
HttpDiscovery(NetworkParameters params,
HttpDiscovery.Details details)
Constructs a discovery object that will read data from the given HTTP[S] URI and, if a public key is provided,
will check the signature using that key.
|
HttpDiscovery(NetworkParameters params,
HttpDiscovery.Details details,
okhttp3.OkHttpClient client) |
HttpDiscovery(NetworkParameters params,
java.net.URI uri,
ECKey pubkey)
Constructs a discovery object that will read data from the given HTTP[S] URI and, if a public key is provided,
will check the signature using that key.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.net.InetSocketAddress> |
getPeers(long services,
long timeoutValue,
java.util.concurrent.TimeUnit timeoutUnit)
Queries the addresses.
|
java.util.List<java.net.InetSocketAddress> |
protoToAddrs(PeerSeedProtos.SignedPeerSeeds proto) |
void |
shutdown()
Stops any discovery in progress when we want to shut down quickly.
|
public HttpDiscovery(NetworkParameters params, java.net.URI uri, @Nullable ECKey pubkey)
public HttpDiscovery(NetworkParameters params, HttpDiscovery.Details details)
public HttpDiscovery(NetworkParameters params, HttpDiscovery.Details details, okhttp3.OkHttpClient client)
public java.util.List<java.net.InetSocketAddress> getPeers(long services,
long timeoutValue,
java.util.concurrent.TimeUnit timeoutUnit)
throws PeerDiscoveryException
PeerDiscoverygetPeers in interface PeerDiscoveryservices - Required services as a bitmask, e.g. VersionMessage.NODE_NETWORK.PeerDiscoveryExceptionpublic java.util.List<java.net.InetSocketAddress> protoToAddrs(PeerSeedProtos.SignedPeerSeeds proto) throws PeerDiscoveryException, com.google.protobuf.InvalidProtocolBufferException, SignatureDecodeException, java.security.SignatureException
PeerDiscoveryExceptioncom.google.protobuf.InvalidProtocolBufferExceptionSignatureDecodeExceptionjava.security.SignatureExceptionpublic void shutdown()
PeerDiscoveryshutdown in interface PeerDiscovery