Commit Graph

577 Commits

Author SHA1 Message Date
Ethan Buchman c3b72ea708
Merge pull request #210 from tendermint/bucky/tmhash
tmhash
2018-05-22 12:09:52 -04:00
Ethan Buchman d468cee107 Merge branch 'master' into develop 2018-05-21 21:40:07 -04:00
Ethan Buchman d970af8724
Merge pull request #212 from tendermint/release/v0.8.3
Release/v0.8.3
2018-05-21 21:30:52 -04:00
Ethan Buchman 06cffa6acb changelog and version 2018-05-21 21:38:02 -04:00
Ethan Buchman d72de8ba68 fix test 2018-05-21 20:26:54 -04:00
Ethan Buchman d82699bf43 tmhash 2018-05-21 20:15:32 -04:00
Ethan Buchman 4fb515fa08
Merge pull request #208 from tendermint/bucky/remotedb
Move remotedb under db
2018-05-21 17:36:18 -04:00
Ethan Buchman f27c358a8a revert protobuf recompile 2018-05-21 17:37:53 -04:00
Zach 31c0c9555e
Merge pull request #209 from tendermint/tm-847
events and pubsub were moved to tendermint core
2018-05-16 08:49:23 -04:00
Anton Kaliaev 4a77eda368
events and pubsub were moved to tendermint core
Refs https://github.com/tendermint/tendermint/issues/847
2018-05-16 12:57:08 +04:00
Ethan Buchman 468be0f8d6 mv remotedb, proto, grpcdb all under db/remotedb 2018-05-14 15:49:00 -04:00
Ethan Buchman 45caff1a20 changelog and version 2018-05-14 15:21:29 -04:00
Jae Kwon a8fcf45624 Change defaults to 100M and 10G respectively 2018-05-10 20:58:28 -07:00
Jae Kwon 2e41756b55 Add logjack command 2018-05-10 20:43:50 -07:00
Christopher Goes 67faf556ed
Merge pull request #162 from tendermint/db-gRPC
DB as a service: remove database deployment with API
2018-05-10 18:46:05 +02:00
Christopher Goes 20be8c75e5
Tweak testcases 2018-05-08 17:13:13 +02:00
Christopher Goes 0b6d101c77
Implement batch operations 2018-05-08 16:38:39 +02:00
Christopher Goes 45514a6013
Address PR comments 2018-05-08 15:47:06 +02:00
Christopher Goes 39e1567d0a
Add iterator tests 2018-05-08 00:53:33 +02:00
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 Odeke 5d12e1eb46
remotedb: a client package implementing the db.DB interface
Simplified the abstractions to remotedb, a package that
allows clients to use whatever database they can in client
code without having to switch out their code e.g
```go
client, err := remotedb.NewInsecure(":9888")
...
// Just like they'd initialize locally
in := &remotedb.Init{
  Name: "test-remote-db",
  Type: "leveldb",
  Dir: "/tmp/dbs",
}

if err := client.InitRemote(in); err != nil {
    log.Fatalf("Failed to initialize the database")
}

v1 := client.Get(k1)
client.Set(k9, dog)

for itr := client.Iterator(a1, z1); itr.Valid(); itr.Next() {
  k, v := itr.Key(), itr.Value()
  dom := itr.Domain()
  ...
}
```
2018-05-07 22:00:38 +02:00
Emmanuel T Odeke 1260b75f63
grpcdb: Better readability for docs and constructor names
* Added some docs for NewClient, BindServer, *server.Init
* Security level clarified, whether "secure" for https
or "insecure" for non-https gRPC connections.
2018-05-07 22:00:38 +02:00
Emmanuel T Odeke 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
Jae Kwon cc5f287c47 Add developer branch 0.8.3 to CHANGELOG 2018-04-23 02:36:49 -07:00
Jae Kwon 9b2a8f07a3 [common] Add ASCIITrim 2018-04-23 01:32:18 -07:00
Anton Kaliaev d94e312673 add MarshalJSON and UnmarshalJSON to BitArray (#200)
See CHANGELOG
2018-04-23 00:16:05 -07:00
Jae Kwon 8fa4211bbd
Fixes TestParallelAbort nondeterministic failure #201 (#202) 2018-04-23 00:07:03 -07:00
Jae Kwon e328006bfe
Jae/fixprefixdb (#199)
* Fix PrefixDB Iterator
* PrefixDB Iterator/ReverseIterator fixes
* Bump version 0.8.2
* Update CHANGELOG.md about DebugDB
* Keep invalid source to be closed
* Use prefixBatch instead of memBatch
2018-04-21 04:25:45 -07:00
Ethan Buchman 357648b8d6 Merge branch 'master' into develop 2018-04-09 16:03:08 +03:00
Ethan Buchman 50ad19541d
Merge pull request #198 from tendermint/release/v0.8.1
Release/v0.8.1
2018-04-09 15:47:27 +03:00
Ethan Buchman 0f92a01737 changelog dates 2018-04-09 15:51:54 +03:00
Thomas Corbière 75345c2046 Use an interface for tags. (#195)
* Use an interface for tags.

* rename TagSet to TagMap.

* add documentation to TagMap.
2018-04-09 14:36:40 +02:00
Sunny Aggarwal a807b5db57 added PrefixEndBytes (#186)
* added PrefixToBytes

* added test

* added comment
2018-04-09 12:51:24 +02:00
Anton Kaliaev 40a73fa75c
Merge pull request #196 from tendermint/joon/simple-proofs-from-map
add SimpleProofsFromMap
2018-04-09 12:40:22 +02:00
mossid 50c521e706 expose KVPair 2018-04-05 21:56:29 +02:00
mossid 2861f795f5 add SimpleProofsFromMap 2018-04-05 21:30:15 +02:00
Jae Kwon 2e24b64fc1 Add IsEmpty; Publish 0.8.1 2018-04-05 03:14:53 -07:00
Jae Kwon fb7bde9c24 Add cause in Error.Error() 2018-04-04 13:43:19 -07:00
Jae Kwon 390de81bbc Release version 0.8.0 2018-04-04 12:30:13 -07:00
Ethan Buchman 5c3d3f0875
Merge pull request #194 from Tilkal/random-missing-methods
Random missing methods
2018-04-03 23:52:16 +03:00
Thomas Corbière 74486f7f93 Add Int63n() and RandInt63n(). 2018-04-03 16:24:38 +02:00
Thomas Corbière d66d43d2ea Add Int31n() and RandInt31n(). 2018-04-03 16:23:36 +02:00
Jae Kwon f457435199 HexBytes formatting; Make computeHashFromAunts more defensive 2018-04-03 07:02:19 -07:00
Ethan Buchman 3cd4dcf13b changelog 2018-04-03 16:23:41 +03:00
Ethan Buchman b5e6f8a446
Merge pull request #191 from Tilkal/random-float64
Add Float64() and RandFloat64().
2018-04-03 16:15:06 +03:00
Ethan Buchman f664b020cd
Merge pull request #189 from mohanson/patch-2
bug fix: WriteFileAtomic
2018-04-03 16:13:56 +03:00
Thomas Corbière 3375dac049 add Float64() and RandFloat64(). 2018-04-03 14:09:50 +02:00
Mohanson b221ca0efa
refine comments 2018-04-03 19:04:09 +08:00