Skip to content
🌎 DHT models (Chord and Kademlia) in golang
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
node
protos
rpc_client
rpc_cluster
rpc_node
.gitattributes
.gitignore
.travis.yml
Gopkg.lock
Gopkg.toml
LICENSE
README.md
test.sh

README.md

go-dht

Build Status

DHT models in golang. Use gRPC for communication.

Protocol

gRPC is used for communication between nodes. Chord and Kad RPCs are defined as two different services in protobuf file. And here's an additional service called DHT, through which clients control DHT node and modify keys in DHT.

Chord

Chord is a DHT protocol and algorithm. Here I use SHA-1 as hashing function, and select first 16 bits of hashing result as node identifier. You may change it in node/chord.go.

To run tests,

go test ./node -v -short

For system test (build cluster and stabilize it, usually takes longer time),

go test ./node -v

To quickly setup a cluster of 50 nodes,

go run ./rpc_cluster

To run a single node,

go run ./rpc_node

To test key modification in cluster (put, query and delete 2000 entries),

go run ./rpc_client

Kademlia

Kademlia is expected to be implemented.

You can’t perform that action at this time.