Commit Graph

566 Commits

Author SHA1 Message Date
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
Thomas Corbière ee67e34519 Fix lint errors (#190)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix receiver names.

* remove omittable code.

* fix dot imports.
2018-04-03 12:23:28 +02:00
Mohanson 29a8cb8d87
add comments. 2018-04-03 16:51:30 +08:00
Mohanson 2fbd9f15fa
bug fix: WriteFileAtomic
Must close file before rename it.
2018-04-03 15:26:47 +08:00
Ethan Buchman a557bb4d0b
Merge pull request #185 from tendermint/bucky/merge-master
Bucky/merge master
2018-04-02 22:26:22 +03:00
Jae Kwon 382e99d06e Add IsTypedNil 2018-04-02 01:47:42 -07:00
Ethan Buchman 41302c206a Merge branch 'master' into develop
* Update changelog
2018-03-31 19:36:05 +03:00
Anton Kaliaev 898216d419
add SplitAndTrim func (#183)
Refs https://github.com/tendermint/tendermint/issues/1380
2018-03-29 12:04:01 +02:00
Anton Kaliaev 0f2811441f
[pubsub] fix unsubscribing (#181)
* [pubsub] fix unsubscribing

by giving it the same exact query, which was used to subscribe

Refs https://github.com/tendermint/tendermint/issues/1368

* use original query to unsubscribe

Refs #1368

* modify the unit test the issue is fixed
2018-03-28 16:04:46 +02:00
Christopher Goes 6e26392209 Return config parse errors (#182) 2018-03-28 15:35:52 +02:00
Jae Kwon e9cf47606c Merge panics into errors in Parallel 2018-03-25 00:04:47 +01:00
Jae Kwon 87c0473730
New Error (#180)
* New Error can capture Stacktrace
* Intelligent ErrorWrap
* Review fixes
2018-03-24 22:19:44 +01:00