public class HttpDiscovery extends 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,
com.squareup.okhttp.OkHttpClient client) |
HttpDiscovery(NetworkParameters params,
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 |
---|---|
InetSocketAddress[] |
getPeers(long services,
long timeoutValue,
TimeUnit timeoutUnit)
Returns an array of addresses.
|
InetSocketAddress[] |
protoToAddrs(PeerSeedProtos.SignedPeerSeeds proto) |
void |
shutdown()
Stops any discovery in progress when we want to shut down quickly.
|
public HttpDiscovery(NetworkParameters params, URI uri, @Nullable ECKey pubkey)
public HttpDiscovery(NetworkParameters params, HttpDiscovery.Details details)
public HttpDiscovery(NetworkParameters params, HttpDiscovery.Details details, com.squareup.okhttp.OkHttpClient client)
public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException
PeerDiscovery
getPeers
in interface PeerDiscovery
services
- Required services as a bitmask, e.g. VersionMessage#NODE_NETWORK
.PeerDiscoveryException
public InetSocketAddress[] protoToAddrs(PeerSeedProtos.SignedPeerSeeds proto) throws PeerDiscoveryException, com.google.protobuf.InvalidProtocolBufferException, SignatureException
PeerDiscoveryException
com.google.protobuf.InvalidProtocolBufferException
SignatureException
public void shutdown()
PeerDiscovery
shutdown
in interface PeerDiscovery
Copyright © 2016. All rights reserved.