libs/db: conditional compilation (#3628)

* libs/db: conditional compilation

For cleveldb: go build -tags cleveldb
For boltdb: go build -tags boltdb

Fixes #3611

* document db_backend param better

* remove deprecated LevelDBBackend

* update changelog

* add missing lines

* add new line

* fix TestRemoteDB

* add a line about boltdb tag

* Revert "remove deprecated LevelDBBackend"

This reverts commit 1aa85453f76605e0c4d967601bbe26240e668d51.

* make PR non breaking

* change DEPRECATED label format

https://stackoverflow.com/a/36360323/820520
This commit is contained in:
Anton Kaliaev
2019-05-07 12:33:47 +04:00
committed by GitHub
parent 27909e5d2a
commit a7358bc69f
14 changed files with 88 additions and 28 deletions

View File

@ -79,9 +79,7 @@ make install
Install [LevelDB](https://github.com/google/leveldb) (minimum version is 1.7).
### Ubuntu
Install LevelDB with snappy (optionally):
Install LevelDB with snappy (optionally). Below are commands for Ubuntu:
```
sudo apt-get update
@ -100,23 +98,23 @@ wget https://github.com/google/leveldb/archive/v1.20.tar.gz && \
rm -f v1.20.tar.gz
```
Set database backend to cleveldb:
Set a database backend to `cleveldb`:
```
# config/config.toml
db_backend = "cleveldb"
```
To install Tendermint, run
To install Tendermint, run:
```
CGO_LDFLAGS="-lsnappy" make install_c
```
or run
or run:
```
CGO_LDFLAGS="-lsnappy" make build_c
```
to put the binary in `./build`.
which puts the binary in `./build`.

View File

@ -30,7 +30,18 @@ moniker = "anonymous"
# and verifying their commits
fast_sync = true
# Database backend: leveldb | memdb | cleveldb
# Database backend: goleveldb | cleveldb | boltdb
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
# - pure go
# - stable
# * cleveldb (uses levigo wrapper)
# - fast
# - requires gcc
# - use cleveldb build tag (go build -tags cleveldb)
# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
# - EXPERIMENTAL
# - may be faster is some use-cases (random reads - indexer)
# - use boltdb build tag (go build -tags boltdb)
db_backend = "leveldb"
# Database directory