Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrewdavidmackenzie opened this issue Dec 4, 2024 · 1 comment
Labels
c-iroh discovery feat New feature or request

Comments

@andrewdavidmackenzie
Copy link

andrewdavidmackenzie commented Dec 4, 2024

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.

@flub flub added c-iroh discovery feat New feature or request labels Dec 4, 2024
@andrewdavidmackenzie
Copy link
Author

Allow the addition of meta-data to discovery via an arbitrary number of key-value TXT pairs like mDNS allows.
Then in the "client" (discoveree) then be able to get the values via key, or iterate through them.

Reference implementations for mDNS:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-iroh discovery feat New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants