tuweni / org.apache.tuweni.devp2p / EphemeralPeerRepository / get

get

fun get(nodeId: PublicKey, endpoint: Endpoint): Peer (source)

Get a peer from node ID and endpoint information

Parameters

nodeId - the peer public key

endpoint - the peer endpoint

Return
the peer

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

Get a Peer based on a URI components.

The returned peer will use the endpoint from the URI, unless the peer is already active, in which case its endpoint will be unchanged.

Parameters

host - the peer host

port - the peer port

nodeId - the public key associated with the peer

suspend fun get(uri: URI): Peer (source)

Get a Peer based on a URI.

The returned peer will use the endpoint from the URI, unless the peer is already active, in which case its endpoint will be unchanged.

Parameters

uri - the enode URI

Exceptions

IllegalArgumentException - if the URI is not a valid enode URI

Return
the peer