From 15e80d244886768e9813ce9d4b7d4c9c19471d83 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 11 Dec 2019 21:15:27 +0400 Subject: [PATCH] config: add rocksdb as a db backend option (#4239) Closes #3831 The support for rocksdb was added a while back in https://github.com/tendermint/tm-db/pull/12. This commit merely updates the documentation. --- CHANGELOG_PENDING.md | 3 ++- cmd/tendermint/commands/run_node.go | 2 +- config/config.go | 6 +++++- config/toml.go | 6 +++++- docs/tendermint-core/configuration.md | 6 +++++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 066f63028..5be7db7f7 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -18,7 +18,7 @@ and a validator address plus a timestamp. Note we may remove the validator address & timestamp fields in the future (see ADR-25). Special thanks to external contributors on this release: -@erikgrinaker, @PSalant726, @gchaincl, @gregzaitsev, @princesinha19 +@erikgrinaker, @PSalant726, @gchaincl, @gregzaitsev, @princesinha19, @Stumble Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint). @@ -98,6 +98,7 @@ program](https://hackerone.com/tendermint). - [p2p] \#4053 Add `unconditional_peer_ids` and `persistent_peers_max_dial_period` config variables (see ADR-050) (@dongsam) - [cli] \#4234 Add `--db_backend and --db_dir` flags (@princesinha19) - [cli] \#4113 Add optional `--genesis_hash` flag to check genesis hash upon startup +- [config] \#3831 Add support for [RocksDB](https://rocksdb.org/) (@Stumble) ### IMPROVEMENTS: diff --git a/cmd/tendermint/commands/run_node.go b/cmd/tendermint/commands/run_node.go index 074ebfbc6..577706461 100644 --- a/cmd/tendermint/commands/run_node.go +++ b/cmd/tendermint/commands/run_node.go @@ -85,7 +85,7 @@ func AddNodeFlags(cmd *cobra.Command) { cmd.Flags().String( "db_backend", config.DBBackend, - "Database backend: goleveldb | cleveldb | boltdb") + "Database backend: goleveldb | cleveldb | boltdb | rocksdb") cmd.Flags().String( "db_dir", config.DBPath, diff --git a/config/config.go b/config/config.go index 2b33c580b..38ea4ba0f 100644 --- a/config/config.go +++ b/config/config.go @@ -160,7 +160,7 @@ type BaseConfig struct { //nolint: maligned // and verifying their commits FastSyncMode bool `mapstructure:"fast_sync"` - // Database backend: goleveldb | cleveldb | boltdb + // Database backend: goleveldb | cleveldb | boltdb | rocksdb // * goleveldb (github.com/syndtr/goleveldb - most popular implementation) // - pure go // - stable @@ -172,6 +172,10 @@ type BaseConfig struct { //nolint: maligned // - EXPERIMENTAL // - may be faster is some use-cases (random reads - indexer) // - use boltdb build tag (go build -tags boltdb) + // * rocksdb (uses github.com/tecbot/gorocksdb) + // - EXPERIMENTAL + // - requires gcc + // - use rocksdb build tag (go build -tags rocksdb) DBBackend string `mapstructure:"db_backend"` // Database directory diff --git a/config/toml.go b/config/toml.go index 223991438..c561ecc69 100644 --- a/config/toml.go +++ b/config/toml.go @@ -86,7 +86,7 @@ moniker = "{{ .BaseConfig.Moniker }}" # and verifying their commits fast_sync = {{ .BaseConfig.FastSyncMode }} -# Database backend: goleveldb | cleveldb | boltdb +# Database backend: goleveldb | cleveldb | boltdb | rocksdb # * goleveldb (github.com/syndtr/goleveldb - most popular implementation) # - pure go # - stable @@ -98,6 +98,10 @@ fast_sync = {{ .BaseConfig.FastSyncMode }} # - EXPERIMENTAL # - may be faster is some use-cases (random reads - indexer) # - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) db_backend = "{{ .BaseConfig.DBBackend }}" # Database directory diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index de6a86230..141645f26 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -39,7 +39,7 @@ moniker = "anonymous" # and verifying their commits fast_sync = true -# Database backend: goleveldb | cleveldb | boltdb +# Database backend: goleveldb | cleveldb | boltdb | rocksdb # * goleveldb (github.com/syndtr/goleveldb - most popular implementation) # - pure go # - stable @@ -51,6 +51,10 @@ fast_sync = true # - EXPERIMENTAL # - may be faster is some use-cases (random reads - indexer) # - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) db_backend = "goleveldb" # Database directory