tuweni / org.apache.tuweni.devp2p / PeerRoutingTable

PeerRoutingTable

interface PeerRoutingTable : Set<Peer> (source)

A routing table for ÐΞVp2p peers.

Functions

add

Add a node to the table.

abstract fun add(node: Peer): Peer?

evict

Remove a node from the table, potentially adding an alternative from the replacement cache.

abstract fun evict(node: Peer): Boolean

nearest

Return the nearest nodes to a target id, in order from closest to furthest.

abstract fun nearest(targetId: PublicKey, limit: Int): List<Peer>