Add bootstrap nodes, DNS-based discovery, a DHT per region and NAT traversal

- Bootstrap: built-in /dnsaddr/allmende.stinnesbeck.com (TXT records at
  _dnsaddr.<name>), resolved at every redial with the last good answer kept;
  --bootstrap takes /p2p/ or /dnsaddr/ entries, --no-default-bootstrap drops
  the built-in one. Stopping never waits for a stuck resolver.
- Remembered peers in peers.json (saved every 5 min and on shutdown, redialled
  at the next start)
- Private Kademlia DHT (/allmende prefix), advertised and looked up per region
  with quick first attempts and a backoff; --no-dht turns it off
- NAT traversal: port mapping, hole punching, AutoRelay through bootstrap nodes
- --public: DHT server and relay for a bootstrap node; prints the TXT records
- Docker, NixOS module (public, defaultBootstrap, QUIC/UDP) and docs updated
- e2e: bootstrap node scenario, seed cache restart, and polling that really polls

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 22:14:34 +01:00
co-authored by Claude Sonnet 5.5
parent a81595e9ee
commit e7bec4fb63
18 changed files with 1281 additions and 69 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ buildGoModule {
# Changes whenever go.mod or go.sum do: set it to lib.fakeHash, build, and
# copy the hash from the error.
vendorHash = "sha256-vUBmsqyS+/qXo3UDYzZmZQYik7rMhOrX7csy56UJbLU=";
vendorHash = "sha256-cls1bwmv+BbBwGx5mfNcihENUuojR5Pog5tfVzBKPU8=";
subPackages = [ "cmd/allmende" ];
env.CGO_ENABLED = "0";