Exploring Veilid Bootstrap

This is early in Veilid's history, 16 Aug 2023.

Went to https://veilid.net, read up on concepts. Joined the Discord.

“All nodes are equal” “Bootstrap nodes publish a network key” “The network key is the network Absent config, a DNS TXT query will be used to startup

At this stage in the project there is little documentation. However, there are Debian/Fedora packages for veilid-server & veilid-cli, which I started with rather than the sources.

Install veilid-server, veilid-cli. Very minimal packages, just the binaries and /etc/veilid-server/veilid-server.conf. -server install tells you how to enable systemd service.

$ veilid-server —help produces the most documentation I've seen so far ...

Specifically, you get a full config output (not sure if it's actually a valid config file yet) with velid-server —dump-config

This reveals some nice defaults, and in particular :- * network.routing_table.bootstrap: bootstrap.veilid.net

But the results from a TXT lookup there are sparse bootstrap.veilid.net. 3600 IN TXT “1,2”

So, when veilid-server starts, it sets config from commandline than starts veilidcore internally. routingtable/tasks/bootstrap.rs tells us a little more ... // Bootstrap TXT Record Format Version 0: // txtversion|envelopesupport|nodeids|hostname|dialinfoshort* // // Split bootstrap node record by '|' and then lists by ','. Example: // 0|0|VLD0:7lxDEabKqgjbe38RtBa3IZLrud84P6NhGP-pRTZzdQ|bootstrap-1.dev.veilid.net|T5150,U5150,W5150/ws

This calls txtlookup on each bootstrap hostname, so we dive into intf/native/system.rs, where txtlookup ends up calling trustdnsresolver by default, which ends up on the local system resolver. The initial TXT query retrieves a list (“1,2”), which is treated as prefixes to the hostname, giving us 1.bootstrap.veilid.net and 2.bootstrap.veilid.net (thanks Discord for helping me notice the second lookups)

1.bootstrap.veilid.net. 2345 IN TXT “0|0|VLD0:m5OY1uhPTq2VWhpYJASmzATsKTC7eZBQmyNs6tRJMmA|bootstrap-1.veilid.net|T5150,U5150,W5150/ws”

2.bootstrap.veilid.net. 3600 IN TXT “0|0|VLD0:6-FfH7TPb70U-JntwjHS7XqTCMK0lhVqPQ17dJuwlBM|bootstrap-2.veilid.net|T5150,U5150,W5150/ws”

I'm not sure why this complexity exists, rather than a simple CNAME alternative; i.e. look up the bootstrap hostname, if there are cname entries then look those up, until there are no CNAMES any more, then use TXT on the remainder.

More discussion on the Discord on this suggested that SRV records might be more appropriate; and of course this is all about the process of joining a network, not operating it, so I need to go do some more reading