iroh icon indicating copy to clipboard operation
iroh copied to clipboard

feat: Publish self-announces as pkarr signed packets through the derper

Open Frando opened this issue 1 year ago • 2 comments

Description

This build on top of #2045.

  • Adds a new frame PublishPkarr to the relay protocol
  • MagicEndpoint will send a pkarr SignedPacket to its home relay whenever it changes home relays
  • The relay server will publish this packet to a pkarr relay, if configured
  • Our relay servers would publish to our our instance of https://github.com/n0-computer/iroh-dns-server/, which would make the records available over DNS, which will give global node resolution with #2045
  • The iroh node gets minimal new configurability: Users can either enable or disable the self-announces

based on #2045

Notes & open questions

Change checklist

  • [ ] Self-review.
  • [ ] Documentation updates if relevant.
  • [ ] Tests if relevant.

Frando avatar Mar 01 '24 13:03 Frando

Did some dogfooding!

used a local iroh-relay to test w/ the following config:

# iroh-relay-config.toml
pkarr_relay = "https://testdns.iroh.link/pkarr"
addr = "[::]:3340"
enable_relay = true
enable_stun = true
stun_port = 3478
hostname = "my.relay.network"

Works with two local nodes dialing by node_id!

Can also confirm that if the relay server is not "pkarr_relay" enabled, the normal relay interactions still work, there is no problem when sending a PkarrPacket from the node to the relay server.

ramfox avatar Mar 28 '24 20:03 ramfox

Took a quick look. I like that this is for generic pkarr packets and not just for the specific use case of node discovery.

Still on the fence whether this should be included with the ~~derper~~ relay or not. But since these are just fully self contained pkarr packets with no additional instructions I think having it as an option is nice. So currently I am slightly in favour.

How exactly would we modify this if we were to change the relay protocol to be more QUIC native? I guess that is a question for @flub when he comes back. I don't really know how that would look like and if it would be horrible or just a bit weird.

rklaehn avatar Apr 03 '24 06:04 rklaehn