Skip to content

Associate meta-data with peers that can be examined as part of local swarm discovery #3002

Open
@andrewdavidmackenzie

Description

@andrewdavidmackenzie

Use case

My app discovers compatible "peers" (my app on another host, or an agent on a Pi, or a usb-connected Pi Pico) and displays a menu of "discovered devices" that the user may connect to via TCP or Iroh.

As there maybe many such devices on the local network, to help the user chose which one they wish to connect to I display a device name (model name), and a serial number in the menu.

For the devices discovered via Iroh I cannot get the devices model name or serial number as part of discovery. I would need to connect to each one and make a request to retrieve it and then the next one and so on.

Request

Allow a peer to associate one or more pieces of meta-data when enabling local_swarm_discovery. Possibly in the form of a number of key-value pairs.

I would use something like:

  • model_name: "Raspberry Pi Zero 2 W"
  • serial_number: I use a 16 byte hex serial number
  • local_tcp_ip: ipv4 address (I could parse this from addresses and try and figure out which one is on the local network, but this is easier)
  • tcp_port: a u16 port number where a client can connect to it over tcp

Peers doing discovery would get this in the data of discovered nodes.

I would:

  • put the correct model name and serial number in the menu I construct from the list of discovered devices)
  • provide a menu option to connect to it by tcp as well as iroh

Later it is possible I would filter based on some of the key-value pairs, but not immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions