A Node.js library for making RPC calls over a Kademlia-based distributed hash table (DHT).
dht-rpc is a Node.js library that implements a Kademlia-based distributed hash table (DHT) for making remote procedure calls (RPC) in decentralized networks. It solves the problem of peer discovery and communication in peer-to-peer applications by providing a robust, self-organizing network layer. Developers can use it to build distributed systems where nodes can find each other, route requests, and store data without central servers.
Developers building decentralized applications, peer-to-peer networks, or distributed systems in Node.js who need reliable node discovery and communication.
dht-rpc offers a lightweight, battle-tested DHT implementation with automatic NAT traversal, adaptive node management, and a simple API for adding custom RPC commands. Its focus on DHT health and security makes it a reliable choice for production peer-to-peer networks.
Make RPC calls over a Kademlia based DHT.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically detects and handles NAT and firewall settings, optimizing connectivity without manual configuration, as highlighted in the key features for remote IP/firewall detection.
Allows easily adding custom commands to the DHT for application-specific logic, enabling tailored peer-to-peer communication, demonstrated in the key-value store example.
Nodes intelligently switch between ephemeral and persistent modes based on network conditions, ensuring DHT health and efficient peer discovery without manual tweaks.
Uses hashed public IP and port for secure routing IDs, providing a tamper-resistant basis for node identification and routing in decentralized networks.
Requires setting up and managing bootstrap nodes with globally accessible IPs, adding initial overhead and potential single points of failure compared to plug-and-play solutions.
The README notes that V5 differs significantly from V4, indicating potential migration challenges and lack of backward compatibility for existing deployments.
Relies on UDP for communication, which may not guarantee delivery or order, necessitating additional application-layer logic for reliable messaging in unstable networks.