ex_wire v0.1.1 ExWire.Handler.Neighbours

Module to handle a response to a Neighbours message, which should be to add the neighbors to the correct K-Buckets.

Jim Nabors is way cool.

Link to this section Summary

Functions

Handler for a Neighbours message

Link to this section Functions

Handler for a Neighbours message.

Examples

iex> message = %ExWire.Message.Neighbours{
...>   nodes: [
...>     %ExWire.Struct.Neighbour{endpoint: %ExWire.Struct.Endpoint{ip: [1, 2, 3, 4], tcp_port: 5, udp_port: nil}, node: <<7, 7>>},
...>     %ExWire.Struct.Neighbour{endpoint: %ExWire.Struct.Endpoint{ip: [5, 6, 7, 8], tcp_port: nil, udp_port: 6}, node: <<8, 8>>}],
...>   timestamp: 1
...> }
iex> ExWire.Handler.Neighbours.handle(%ExWire.Handler.Params{
...>   remote_host: %ExWire.Struct.Endpoint{ip: [1,2,3,4], udp_port: 55},
...>   signature: 2,
...>   recovery_id: 3,
...>   hash: <<5>>,
...>   data: message |> ExWire.Message.Neighbours.encode(),
...>   timestamp: 123,
...> })
:no_response