module DEVp2p::Kademlia

Node discovery and network formation are implemented via a Kademlia-like protocol. The major differences are that packets are signed, node ids are the public keys, and DHT-related features are excluded. The FIND_VALUE and STORE packets are not implemented.

The parameters necessary to implement the protocol are:

* bucket size of 16 (denoted k in Kademlia)
* concurrency of 3 (denoted alpha)
* 8 bits per hop (denoted b) for routing
* The eviction check interval is 75 milliseconds
* request timeouts are 300ms
* idle bucket-refresh interval is 3600 seconds

Aside from the previously described exclusions, node discovery closely follows system and protocol described by Maymounkov and Mazieres.

Constants

A
B
IDLE_BUCKET_REFRESH_INTERVAL
ID_SIZE
K
MAX_NODE_ID
PUBKEY_SIZE
REQUEST_TIMEOUT

Public Class Methods

random_nodeid() click to toggle source
# File lib/devp2p/kademlia.rb, line 34
def random_nodeid
  SecureRandom.random_number(MAX_NODE_ID+1)
end