mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-28 13:41:21 +00:00
Merge pull request #208 from tendermint/bucky/remotedb
Move remotedb under db
This commit is contained in:
commit
4fb515fa08
@ -1,9 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 0.8.3 (develop branch)
|
||||
## 0.8.3 (May 14th, 2018)
|
||||
|
||||
FEATURES:
|
||||
|
||||
- [db/remotedb] New DB type using an external CLevelDB process via
|
||||
GRPC
|
||||
- [autofile] logjack command for piping stdin to a rotating file
|
||||
- [common] ASCIITrim()
|
||||
|
||||
|
6
Makefile
6
Makefile
@ -72,12 +72,12 @@ gen_certs: clean_certs
|
||||
certstrap init --common-name "tendermint.com" --passphrase ""
|
||||
certstrap request-cert -ip "::" --passphrase ""
|
||||
certstrap sign "::" --CA "tendermint.com" --passphrase ""
|
||||
mv out/::.crt out/::.key remotedb
|
||||
mv out/::.crt out/::.key db/remotedb
|
||||
|
||||
clean_certs:
|
||||
## Cleaning TLS testing certificates...
|
||||
rm -rf out
|
||||
rm -f remotedb/::.crt remotedb/::.key
|
||||
rm -f db/remotedb/::.crt db/remotedb/::.key
|
||||
|
||||
test: gen_certs
|
||||
go test -tags gcc $(shell go list ./... | grep -v vendor)
|
||||
@ -135,4 +135,4 @@ metalinter_all:
|
||||
.PHONY: check protoc build check_tools get_tools get_protoc update_tools get_vendor_deps test fmt metalinter metalinter_all gen_certs clean_certs
|
||||
|
||||
grpc_dbserver:
|
||||
protoc -I proto/ proto/defs.proto --go_out=plugins=grpc:proto
|
||||
protoc -I db/remotedb/proto/ db/remotedb/proto/defs.proto --go_out=plugins=grpc:db/remotedb/proto
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
||||
protodb "github.com/tendermint/tmlibs/proto"
|
||||
protodb "github.com/tendermint/tmlibs/db/remotedb/proto"
|
||||
)
|
||||
|
||||
// Security defines how the client will talk to the gRPC server.
|
@ -5,8 +5,8 @@ import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
grpcdb "github.com/tendermint/tmlibs/grpcdb"
|
||||
protodb "github.com/tendermint/tmlibs/proto"
|
||||
grpcdb "github.com/tendermint/tmlibs/db/remotedb/grpcdb"
|
||||
protodb "github.com/tendermint/tmlibs/db/remotedb/proto"
|
||||
)
|
||||
|
||||
func Example() {
|
@ -10,7 +10,7 @@ import (
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
||||
"github.com/tendermint/tmlibs/db"
|
||||
protodb "github.com/tendermint/tmlibs/proto"
|
||||
protodb "github.com/tendermint/tmlibs/db/remotedb/proto"
|
||||
)
|
||||
|
||||
// ListenAndServe is a blocking function that sets up a gRPC based
|
@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/grpcdb"
|
||||
protodb "github.com/tendermint/tmlibs/proto"
|
||||
"github.com/tendermint/tmlibs/db/remotedb/grpcdb"
|
||||
protodb "github.com/tendermint/tmlibs/db/remotedb/proto"
|
||||
)
|
||||
|
||||
type RemoteDB struct {
|
@ -2,12 +2,13 @@ package remotedb_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tmlibs/grpcdb"
|
||||
"github.com/tendermint/tmlibs/remotedb"
|
||||
"github.com/tendermint/tmlibs/db/remotedb"
|
||||
"github.com/tendermint/tmlibs/db/remotedb/grpcdb"
|
||||
)
|
||||
|
||||
func TestRemoteDB(t *testing.T) {
|
||||
@ -26,7 +27,14 @@ func TestRemoteDB(t *testing.T) {
|
||||
|
||||
client, err := remotedb.NewRemoteDB(ln.Addr().String(), cert)
|
||||
require.Nil(t, err, "expecting a successful client creation")
|
||||
require.Nil(t, client.InitRemote(&remotedb.Init{Name: "test-remote-db", Type: "leveldb"}))
|
||||
dbName := "test-remote-db"
|
||||
require.Nil(t, client.InitRemote(&remotedb.Init{Name: dbName, Type: "leveldb"}))
|
||||
defer func() {
|
||||
err := os.RemoveAll(dbName + ".db")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
k1 := []byte("key-1")
|
||||
v1 := client.Get(k1)
|
@ -1,3 +1,3 @@
|
||||
package version
|
||||
|
||||
const Version = "0.8.2"
|
||||
const Version = "0.8.3"
|
||||
|
Loading…
x
Reference in New Issue
Block a user