A Simple demonstration to understand the algorithms and operation of Distributed Hash Tables.
go build DHT-implementation
./DHT-implementationRun as many nodes as you want. The port number will be self-assigned. Just keep 8000 free from other applications.
-
"/"
a. UseGETmethod to retrieve values. Pass this as JSON body.{ "key": "someQueryKey" }b. Use
PUTmethod to retrieve values. Pass this as JSON body.{ "key": "someKey", "value": "someValue" }c. Use
DELETEmethod to delete data. Pass this as JSON body.{ "key": "someKeyToDelete" } -
"/data"
GETmethod to retrieve all data. No body required. -
"/node"
GETmethod to get all node metadata. No body required.
Example:GET localhost:8002/node
Rest of the routes are internal to the function of the application and are being used for inter-node communication.