ex_wire v0.1.1 ExWire.Message.FindNeighbours
A wrapper for ExWire’s FindNeighbours message.
“Id of a node. The responding node will send back nodes closest to the target.”
Link to this section Summary
Functions
Decodes a given message binary, which is assumed to be an RLP encoded list of elements
Given a FindNeighbours message, encodes it so it can be sent on the wire in RLPx
Callback implementation for ExWire.Message.message_id/0
FindNeighbours messages do not specify a destination
Link to this section Types
Link to this type
t()
t() :: %ExWire.Message.FindNeighbours{target: ExWire.node_id, timestamp: integer}
Link to this section Functions
Decodes a given message binary, which is assumed to be an RLP encoded list of elements.
Examples
iex> ExWire.Message.FindNeighbours.decode([<<1>>, 2] |> ExRLP.encode)
%ExWire.Message.FindNeighbours{
target: <<1>>,
timestamp: 2,
}
iex> ExWire.Message.FindNeighbours.decode([<<1>>] |> ExRLP.encode)
** (MatchError) no match of right hand side value: [<<1>>]
Given a FindNeighbours message, encodes it so it can be sent on the wire in RLPx.
Examples
iex> ExWire.Message.FindNeighbours.encode(%ExWire.Message.FindNeighbours{target: <<1>>, timestamp: 2})
...> |> ExRLP.decode()
[<<1>>, <<2>>]
Callback implementation for ExWire.Message.message_id/0.