From e1bda36c6ccc665df14819c82e38d67a1f0399b7 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 17 Sep 2018 13:25:17 +0400 Subject: [PATCH] switch back to original fork --- Gopkg.lock | 16 ++++++++-------- Gopkg.toml | 4 ++-- docs/introduction/install.md | 26 ++++++++++++++------------ libs/db/Makefile | 4 ---- libs/db/c_level_db.go | 2 +- state/txindex/kv/kv_test.go | 2 +- 6 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 libs/db/Makefile diff --git a/Gopkg.lock b/Gopkg.lock index 9a27f344..8deb0637 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,13 +1,6 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -[[projects]] - digest = "1:5da259989116f6ab5e05a80086c639c82efdbdb799ca07183eb0b660edfd91fe" - name = "github.com/DataDog/leveldb" - packages = ["."] - pruneopts = "UT" - revision = "12a0b6e10a5bf779330ed8b7c0f1f39f212d34e2" - [[projects]] branch = "master" digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" @@ -168,6 +161,13 @@ revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" +[[projects]] + digest = "1:39b27d1381a30421f9813967a5866fba35dc1d4df43a6eefe3b7a5444cb07214" + name = "github.com/jmhodges/levigo" + packages = ["."] + pruneopts = "UT" + revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" + [[projects]] branch = "master" digest = "1:a64e323dc06b73892e5bb5d040ced475c4645d456038333883f58934abbf6f72" @@ -511,7 +511,6 @@ analyzer-name = "dep" analyzer-version = 1 input-imports = [ - "github.com/DataDog/leveldb", "github.com/btcsuite/btcutil/base58", "github.com/btcsuite/btcutil/bech32", "github.com/ebuchman/fail-test", @@ -530,6 +529,7 @@ "github.com/golang/protobuf/proto", "github.com/golang/protobuf/ptypes/timestamp", "github.com/gorilla/websocket", + "github.com/jmhodges/levigo", "github.com/pkg/errors", "github.com/prometheus/client_golang/prometheus", "github.com/prometheus/client_golang/prometheus/promhttp", diff --git a/Gopkg.toml b/Gopkg.toml index cda7988c..d3bca19e 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -73,8 +73,8 @@ ## Pin to revision [[override]] - name = "github.com/DataDog/leveldb" - revision = "12a0b6e10a5bf779330ed8b7c0f1f39f212d34e2" + name = "github.com/jmhodges/levigo" + revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" [[constraint]] name = "github.com/ebuchman/fail-test" diff --git a/docs/introduction/install.md b/docs/introduction/install.md index 925ed2a8..c7b83b03 100644 --- a/docs/introduction/install.md +++ b/docs/introduction/install.md @@ -77,22 +77,24 @@ make install ## Compile with CLevelDB support -Make sure you have a roughly compatible version of libstdc++ (tested with -5.3.1). For example, on Ubuntu: +Install [LevelDB](https://github.com/google/leveldb) (minimum version is 1.7) +with snappy. Example for Ubuntu: ``` sudo apt-get update -sudo apt-get install gcc -sudo apt-cache show libstdc++6 -Version: 5.3.1-14ubuntu2 -``` +sudo apt install build-essential -Check out leveldb dependency using git (for some reason dep does not check out -submodules): +sudo apt-get install libsnappy-dev -``` -cd vendor/github.com/DataDog && rm -rf leveldb -git clone https://github.com/DataDog/leveldb.git +wget https://github.com/google/leveldb/archive/v1.20.tar.gz && \ + tar -zxvf v1.20.tar.gz && \ + cd leveldb-1.20/ && \ + make && \ + sudo scp -r out-static/lib* out-shared/lib* /usr/local/lib/ && \ + cd include/ && \ + sudo scp -r leveldb /usr/local/include/ && \ + sudo ldconfig && \ + rm -f v1.20.tar.gz ``` Set database backend to cleveldb: @@ -105,5 +107,5 @@ db_backend = "cleveldb" To build Tendermint, run ``` -CGO_ENABLED=1 CGO_CXXFLAGS_ALLOW="(-fno-builtin-memcmp|-lpthread)" CGO_CFLAGS_ALLOW="-fno-builtin-memcmp" go build -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" -tags "tendermint gcc" -o build/tendermint ./cmd/tendermint/ +CGO_LDFLAGS="-lsnappy" go build -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" -tags "tendermint gcc" -o build/tendermint ./cmd/tendermint/ ``` diff --git a/libs/db/Makefile b/libs/db/Makefile deleted file mode 100644 index e0cd45b0..00000000 --- a/libs/db/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test_gcc: - CGO_CXXFLAGS_ALLOW="(-fno-builtin-memcmp|-lpthread)" CGO_CFLAGS_ALLOW="-fno-builtin-memcmp" go test -tags gcc - -.PHONY: test_gcc diff --git a/libs/db/c_level_db.go b/libs/db/c_level_db.go index 10f03aa0..30746126 100644 --- a/libs/db/c_level_db.go +++ b/libs/db/c_level_db.go @@ -7,7 +7,7 @@ import ( "fmt" "path/filepath" - levigo "github.com/DataDog/leveldb" + "github.com/jmhodges/levigo" ) func init() { diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index f6ebe822..78a76168 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -196,7 +196,7 @@ func benchmarkTxIndex(txsCount int64, b *testing.B) { } defer os.RemoveAll(dir) // nolint: errcheck - store := db.NewDB("tx_index", "bboltdb", dir) + store := db.NewDB("tx_index", "leveldb", dir) indexer := NewTxIndex(store) batch := txindex.NewBatch(txsCount)