2018-05-15 01:31:26 +01:00
# gRPC Server + BoltDB Crud Interface
2018-05-30 03:47:40 +01:00
This is a gRPC server which handles CRUD (create, read, update, delete) requests for storing pointers at given paths in BoltDB.
An example Put Request to store a path and pointer would look like this:
```
pr := proto.PutRequest{
Path: []byte("here's/a/pointer/path"),
Pointer: & proto.Pointer{
Type: proto.Pointer_INLINE,
Encryption: & proto.EncryptionScheme{
EncryptedEncryptionKey: []byte("key"),
EncryptedStartingNonce: []byte("nonce"),
},
InlineSegment: []byte("littledata"),
},
}
```
2018-05-15 01:31:26 +01:00
To run the server:
```
2018-07-06 20:43:53 +01:00
go run cmd/pointerdb/main.go
2018-05-15 01:31:26 +01:00
```
You can also run using these flags: `-port=<port-number> -prod=<bool> -db=<db-name>`
2018-05-30 03:47:40 +01:00
You can then write a client program using the client library to access the Put, Get, List, and Delete methods to create and interact with pointer entries stored in BoltDB.
2018-07-06 20:43:53 +01:00
An example program utilizing these functions can be found at `storj.io/storj/examples/pointerdb-client/main.go` .
2018-05-15 01:31:26 +01:00
Afterward, you can also use [Bolter ](https://github.com/hasit/bolter ) or a similar BoltDB viewer to make sure your files were changed as expected.
2018-07-06 20:43:53 +01:00
If changes are made to `storj.io/storj/protos/pointerdb/pointerdb.proto` , the protobuf file will need to be regenerated by running `go generate` inside `protos/pointerdb` .
2018-05-15 01:31:26 +01:00