tuweni / org.apache.tuweni.devp2p / DevP2PPeerRoutingTable

DevP2PPeerRoutingTable

class DevP2PPeerRoutingTable : PeerRoutingTable (source)

A Peer routing table for the Ethereum ÐΞVp2p network.

This is an implementation of a KademliaRoutingTable using keccak256 hashed node ids and a k-bucket size of 6.

Constructors

<init>

DevP2PPeerRoutingTable(selfId: PublicKey)

Create a new ÐΞVp2p routing table.

Properties

size

val size: Int

Functions

add

fun add(node: Peer): Peer?

Add a node to the table.

contains

fun contains(element: Peer): Boolean

containsAll

fun containsAll(elements: Collection<Peer>): Boolean

evict

fun evict(node: Peer): Boolean

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

isEmpty

fun isEmpty(): Boolean

iterator

fun iterator(): Iterator<Peer>

nearest

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

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