Skip to content

v0.4.0 - DHT for Decentralized Peer Discovery

Latest

Choose a tag to compare

@code3hr code3hr released this 30 Dec 21:25
· 31 commits to main since this release

What's New

This release adds Kademlia-style DHT for decentralized peer discovery, enabling nodes to find each other globally without centralized bootstrap servers.

DHT (Distributed Hash Table)

  • Kademlia-style DHT for decentralized peer discovery
  • 256-bit XOR distance metric for node routing
  • K-buckets (K=8) with 256 buckets for routing table organization
  • Iterative lookup with parallel queries (alpha=3)
  • Bucket refresh and node liveness checking (ping/pong)
  • All DHT messages fit 250-byte LoRa constraint
  • DHT message types: PING, PONG, FIND_NODE, FIND_NODE_RESP, STORE, STORE_RESP
  • Integration with discovery (local peers auto-populate DHT)
  • CYXWIZ_DHT_SEEDS environment variable for bootstrapping

Daemon Integration

  • DHT context creation and polling in main loop
  • DHT message handling in message dispatcher
  • /dht command to show DHT statistics
  • DHT cleanup on shutdown

Changed

  • Discovery module now supports optional DHT attachment via cyxwiz_discovery_set_dht()

Full Changelog: v0.3.0...v0.4.0