Module discover

Module discover 

Source
Expand description

discover: who else is out there.

Two mechanisms wearing one command. Nodes advertise their identity on their own schedule, so a radio that simply listens learns who is nearby eventually; and a node may ask, with an Identity Request that everyone in earshot answers. This asks once and then listens, which is what makes the answer arrive in a minute rather than in an hour.

The ask is a zero-hop broadcast with no flood budget: repeaters never carry it, so it reaches exactly the nodes that can hear this radio. Reaching further is what --via is for โ€” it steers the question through the routers on the way to a node this tool already knows how to reach, and the answers come home along the trace the question accumulated.

Structsยง

DiscoverArgs

Enumsยง

CapFilter
RoleFilter
The roles a request can single out.

Constantsยง

POLL ๐Ÿ”’
How long a single pump waits before the deadline is checked again.
REQUEST_FRAME ๐Ÿ”’
Room for the request frame: an option block of a nonce and three filters, and the payload type byte in front of it.

Functionsยง

advertisement ๐Ÿ”’
Read a packet as a node identity advertisement, if that is what it is.
ask ๐Ÿ”’
Broadcast one Identity Request, and return the nonce it carries so the answers can be told from unsolicited advertisements.
capability_names ๐Ÿ”’
describe_ask ๐Ÿ”’
How the ask reads back, so the report says what was actually asked.
discover
discover: ask once, then listen.
explore ๐Ÿ”’
report ๐Ÿ”’
Print one node, the first time it is heard.
request_frame ๐Ÿ”’
The Identity Request payload this ask sends, payload-type byte and all.
role_name ๐Ÿ”’
steer_through ๐Ÿ”’
The router hints that steer a question through peer to whatever is around it.