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

get

suspend fun get(nodeId: PublicKey): Peer (source)

Overrides PeerRepository.get

Get a peer.

Parameters

nodeId - the node id

Return
the peer

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

Overrides PeerRepository.get

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