-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The current state of the running DHT is a simple GRPC server running to which we cannot directly interact, i.e. We cannot store or retrieve data from outside. To fix this, we have to introduce HTTP or GRPC endpoints to the running node that does the following:
GET call to /get with
- payload key=<search-key-in-string-format> (we might have to change the format of the key in the future)
- response will be a list of strings
PUT call to /put with
- payload key=<search-key-in-string-format> and value=<value-in-string-format>
- response will be a status code
For the sake of simplicity we can just introduce an HTTP endpoint instead of GRPC to begin with.
Ideally this layer would communicate with PeARS and generate the vector representaion for the query string in the future
Development ideas
Currently when we run a node (go run main.go), it starts a GRPC service in a goroutine which can be called by another node to connect, get value, put value etc. The simplest solution here could be to start another server in the main function which would be a simple HTTP server, which will have get and put endpoints. Upon calling this endpoints, the server would call the get and set methods of the node object (already initialized in the main function) directly.