storj/cmd/netstate-rpc/server/README.md
Natalie Villasana 1a06c2b0c7 adding grpc interface to network state (#33)
* adds proto files for netstate crud

* moves netstate grpc client lib into pkg/netstate where grpc netstate service is defined

* starts adding grpc client and server tests

* moves creation of grpc server into cmd/netstate/main.go, removes pkg/netstate/service.go, adds more client testing

* changed all 'Path' and 'Value' fields from strings to bytes, updated tests

* changes Get and Delete in proto file to receive 'requests' instead of 'file paths', adds tests for Get, List, and Delete

* changes netstate-routes to get 'fileValue' bytes not 'fileInfo'

* adds example rpc client in 'examples' and adds more specific debug logs

* adds readmes for netstate rpc services and updates netstate-routes
2018-05-14 18:31:26 -06:00

1.0 KiB

gRPC Server + BoltDB Crud Interface

This is a gRPC server which handles CRUD (create, read, update, delete) requests for storing file paths and small values to BoltDB. For example, you can store a value (i.e. "hello world") at /my/test/file and interact with /my/test/file through an API, backed by BoltDB.

To run the server:

go run cmd/netstate-rpc/server/main.go

You can also run using these flags: -port=<port-number> -prod=<bool> -db=<db-name>

You can then write a client program using the client library to access the Put, Get, List, and Delete methods to create/interact with small values stored in a BoltDB. An example program utilizing these functions can be found at storj.io/storj/examples/netstate-client/main.go.

Afterward, you can also use Bolter or a similar BoltDB viewer to make sure your files were changed as expected.

If changes are made to storj.io/storj/protos/netstate/netstate.proto, the protobuf file will need to be regenerated by running go generate inside protos/netstate.