tuweni / org.apache.tuweni.kademlia / KademliaRoutingTable / create

create

@JvmStatic fun <T> create(selfId: ByteArray, k: Int, nodeId: Function<T, ByteArray>, distanceToSelf: Function<T, Int>): KademliaRoutingTable<T> (source)

Create a new routing table.

Parameters

selfId - the ID of the local node

k - the size of each bucket (k value)

nodeId - a function for obtaining the id of a network node

Parameters

Return
A new routing table

@JvmStatic fun <T> create(selfId: ByteArray, k: Int, maxReplacements: Int, nodeId: Function<T, ByteArray>, distanceToSelf: Function<T, Int>): KademliaRoutingTable<T> (source)

Create a new routing table.

Parameters

selfId - the ID of the local node

k - the size of each bucket (k value)

maxReplacements - the maximum number of replacements to cache in each bucket

nodeId - a function for obtaining the id of a network node

Parameters

Return
A new routing table