Dswarm
dht swarm with websockets and secret handshake
Install / Use
/learn @distributed-mind/DswarmREADME
DHT Swarm
this is a practice in UDP Multicasting, and DHT experimentation in a localhost. the idea is to run as many instances of this daemon as you want, and all instances will find eachother via udp multicast and build a dht network. each peer of the network generates an ed25519 keypair, and binds to a random port. the port is an http service that takes requests at these endpoints:
- /dht
- /api
the /dht endpoint serves websocket rpc requests
the /api endpoint serves https curl requests. right now the only implemented rpc call is "ping"
its all a work-in-progress. more work to be added soon.
swarm
as each instance of this is executed on the network (or on the same computer), every 5 seconds the instance broadcasts a UDP packet containing a newly generated public key, a random service port, and consequentially its own ip address from the IP packet. each time an instance receives a UDP multicast packet, it checks the new peer's public key against a map, if its a newly found peer, it will log it to stdout, and add it to the map in memory. the bucket is printed every 5 seconds
demo
git clonethis project, or download here: master.zip- use
./build.shto build in docker, or just usego build - open two terminal windows:
- in one terminal, run
./demo.shto spawn ten instances - in another terminal curl the api to perform an RPC ping
curl -kvs https://localhost:port/api/ping
^^^ this will tell the peer to perform an RPC ping to the top three closest peers in the bucket.

note
some things to note:
- all peers use 32 byte length keys for node-IDs, dht distance metrics, and i plan on using sha256 hashes for the dht keys, this parts from the kademlia standard
- all peer dht connections use a self-signed certificate, i dunno, for fun
- only the "ping" rpc method is implemented right now, more to come
- secret handshake is used to ensure each peer is connecting to the right peerID (public-key validation)
- this project is intended to be a local test-bed for playing with DHTs, hence the api endpoint
Related Skills
canvas
343.3kCanvas Skill Display HTML content on connected OpenClaw nodes (Mac app, iOS, Android). Overview The canvas tool lets you present web content on any connected node's canvas view. Great for: -
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
