tuweni / org.apache.tuweni.ethclient / DiscoveryPeerRepository

DiscoveryPeerRepository

class DiscoveryPeerRepository : PeerRepository (source)

Constructors

<init>

DiscoveryPeerRepository(repository: PeerRepository)

Functions

addListener

Adds a listener to the repository, which will consume peer entries whenever they are added to the repository.

fun addListener(listener: (Peer) -> Unit): Unit

get

Get a Peer based on a URI components.

suspend fun get(host: String, port: Int, nodeId: PublicKey): Peer

Get a Peer based on a URI.

suspend fun get(uri: URI): Peer

getAsync

Get a Peer based on a URI.

fun getAsync(uri: URI): AsyncResult<Peer>

Get a Peer based on a URI string.

fun getAsync(uri: String): AsyncResult<Peer>