rc-kademlia 🕸️
This is a DHT for use on a local network. It takes bootstrap peer information or will broadcast on port 1338 asking for local peers. The local peer discovery uses udp Datagrams
which can be relied upon to arrive as a whole message. A small binary packet is used to communicate info
Install
npm install rc-kademlia
Development
To build and run 10 nodes type
docker-compose up --build --scale node=10
Example
Overview
API
tk
TK means "to come" in editing parlance. This isn't a real function - the api is TK
size
can be betweeen 1 and Infinity
.
// batch 10 pokemon while we process themfor await of batch10, getPokemon
Contributors wanted!
Writing docs and code is a lot of work! Thank you in advance for helping out.
TODO
Tomorrow I want to get
- limit local peer discovery to one node
-
find_node
request and response flow - the recursive
find_node
search - actual good
find_node
results - dht bootstrapping process (does this need a real address book with actual k-buckets? Maybe)
- A better way of visualizing what's going on
Thing I probably won't do
- peer state and removal
- responses should count as a pong
-
store
andfind_value
- a real k-bucket address book
Things I'll probably have to do but don't want to
- test with many more peers
- visualize what's going on with many more peers