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.net.InetSocketAddress[] |
getPeers(long services,
long timeoutValue,
java.util.concurrent.TimeUnit timeoutUnit)
Returns an array of addresses.
|
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.net.InetSocketAddress[] getPeers(long services, long timeoutValue, java.util.concurrent.TimeUnit timeoutUnit) throws PeerDiscoveryException
PeerDiscovery
getPeers
in interface PeerDiscovery
services
- Required services as a bitmask, e.g. VersionMessage.NODE_NETWORK
.PeerDiscoveryException
public java.net.InetSocketAddress[] protoToAddrs(PeerSeedProtos.SignedPeerSeeds proto) throws PeerDiscoveryException, com.google.protobuf.InvalidProtocolBufferException, SignatureDecodeException, java.security.SignatureException
PeerDiscoveryException
com.google.protobuf.InvalidProtocolBufferException
SignatureDecodeException
java.security.SignatureException
public void shutdown()
PeerDiscovery
shutdown
in interface PeerDiscovery