Commit Graph
23 Commits
Author SHA1 Message Date
Christopher Goes 55f4ccd4fc CI fix 2018-05-07 23:28:41 +02:00
Christopher Goes 2cca5a7a4c Implement TLS/SSL 2018-05-07 23:16:06 +02:00
Christopher Goes bf16d6453c Address PR comments 2018-05-07 22:12:26 +02:00
Emmanuel T OdekeandChristopher Goes 11bee6194a DB as a service
Fixes https://github.com/tendermint/tendermint/issues/1162

Databases as a service!

Can now access Databases as a remote service
via gRPC for performance and easy deployment.

The caveat is that each service is stateful in regards to
the DB i.e. each unique service uses only one unique DB
but nonetheless multiple clients can access it.

A full standalone example

```go
package main

import (
  "bytes"
  "context"
  "log"

  grpcdb "github.com/tendermint/tmlibs/grpcdb"
  protodb "github.com/tendermint/tmlibs/proto"
)

func main() {
  addr := ":8998"
  go func() {
    if err := grpcdb.BindRemoteDBServer(addr); err != nil {
      log.Fatalf("BindRemoteDBServer: %v", err)
    }
  }()

  client, err := grpcdb.NewClient(addr, false)
  if err != nil {
    log.Fatalf("Failed to create grpcDB client: %v", err)
  }

  ctx := context.Background()
  // 1. Initialize the DB
  in := &protodb.Init{
    Type: "leveldb",
    Name: "grpc-uno-test",
    Dir:  ".",
  }
  if _, err := client.Init(ctx, in); err != nil {
    log.Fatalf("Init error: %v", err)
  }

  // 2. Now it can be used!
  query1 := &protodb.Entity{Key: []byte("Project"), Value:
[]byte("Tmlibs-on-gRPC")}
  if _, err := client.SetSync(ctx, query1); err != nil {
    log.Fatalf("SetSync err: %v", err)
  }

  query2 := &protodb.Entity{Key: []byte("Project")}
  read, err := client.Get(ctx, query2)
  if err != nil {
    log.Fatalf("Get err: %v", err)
  }
  if g, w := read.Value, []byte("Tmlibs-on-gRPC"); !bytes.Equal(g, w) {
    log.Fatalf("got= (%q ==> % X)\nwant=(%q ==> % X)", g, g, w, w)
  }
}
```
2018-05-07 22:00:33 +02:00
Zaki ManianandAnton Kaliaev 26f2ab65f8 Switch to dep from glide (#155) 2018-02-27 16:01:49 +04:00
Jae KwonandAnton Kaliaev ff230682d1 Fix logical time (#122)
Should fix a nondeterministic bug so...
2018-02-02 12:51:30 +04:00
Ethan Buchman 1460540acd metalinter is for another time 2018-01-02 11:05:39 -05:00
Ethan Buchman 7fe3d5dac2 metalinter 2018-01-02 10:48:36 -05:00
Ethan BuchmanandGitHub a991e2fe9c Merge branch 'develop' into sdk2 2018-01-02 10:29:04 -05:00
Jae Kwon b25df389db Remove Bytes, just use []byte; Use protobuf for KVPair/KI64Pair 2017-12-26 04:40:35 -08:00
Jae Kwon 6ec8c1602f Update Makefile 2017-12-25 22:41:40 -08:00
Ethan Buchman 57fea1335a Makefile and linter 2017-11-29 05:08:05 +00:00
Jae KwonandGitHub 8481c49c82 CacheDB (#67)
* Add CacheDB & SimpleMap
* Generic memBatch; Fix cLevelDB tests
* CacheWrap() for CacheDB and MemDB
* Change Iterator to match LeviGo Iterator
* Fixes from review
* cacheWrapWriteMutex and some race fixes
* Use tmlibs/common
* NewCWWMutex is exposed.  DB can be CacheWrap'd
* Remove GetOK, not needed
* Fsdb (#72)
* Add FSDB
* Review fixes from Anton
* Review changes
* Fixes from review
2017-11-09 17:42:32 -05:00
Zach Ramsay cf49ba876f linter: couple fixes 2017-10-03 17:23:14 -04:00
Zach Ramsay 2681f32bdd circle: add metalinter to test 2017-09-22 12:35:52 -04:00
Zach Ramsay 3c57c24921 linting: next round of fixes 2017-09-22 12:14:27 -04:00
Zach Ramsay d6e03d2368 linting: add to Makefile & do some fixes 2017-09-22 11:42:29 -04:00
Anton Kaliaev 240215f2aa return back all in Makefile 2017-05-05 21:52:01 +04:00
Anton Kaliaev 6ff7b4395d update glide.yaml and glide.lock files 2017-05-05 21:48:02 +04:00
Ethan FreyandEthan Buchman d05b8131a3 Updated glide with cobra/viper, fixed Makefile typo 2017-05-04 19:44:48 -04:00
Ethan Buchman af637abf12 Makefile and circle.yml 2017-05-01 11:30:24 -04:00
Ethan Buchman fe92e62a19 merge go-events 2017-04-18 16:33:40 -04:00
Ethan Frey a816ff0bab Add test 2017-02-27 14:52:48 +01:00