feat: Publish self-announces as pkarr signed packets through the derper
Description
This build on top of #2045.
- Adds a new frame
PublishPkarrto 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.
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.
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.