Module darkfi::net::protocol::protocol_address

source ·
Expand description

Protocol for address and get-address messages. Implements how nodes exchange connection information about other nodes on the network. Address and get-address messages are exchanged continually alongside ping-pong messages as part of a network connection.

Protocol starts by creating a subscription to address and get-address messages. Then the protocol sends out a get-address message and waits for an address message. Upon receiving address messages, nodes validate and add the address information to their local store.


  • Defines address and get-address messages. On receiving GetAddr, nodes reply an AddrMessage containing nodes from their hostlist. On receiving an AddrMessage, nodes enter the info into their greylists.


  • A vector of all currently accepted transports and valid transport combinations. Should be updated if and when new transports are added. Creates a upper bound on the number of transports a given peer can request.