Skip to content

Implement an interface to connect to the running local DHT #12

@nandajavarma

Description

@nandajavarma

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions