A Simple demonstration to understand the algorithms and operation of Distributed Hash Tables.
go build DHT-implementation
./DHT-implementation
Run as many nodes as you want. The port number will be self-assigned. Just keep 8000
free from other applications.
-
"/"
a. UseGET
method to retrieve values. Pass this as JSON body.{ "key": "someQueryKey" }
b. Use
PUT
method to retrieve values. Pass this as JSON body.{ "key": "someKey", "value": "someValue" }
c. Use
DELETE
method to delete data. Pass this as JSON body.{ "key": "someKeyToDelete" }
-
"/data"
GET
method to retrieve all data. No body required. -
"/node"
GET
method 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.