chore: modify db support (#14451)

This commit is contained in:
Marko 2022-12-30 15:08:37 +01:00 committed by GitHub
parent f3dd51029a
commit e048402efb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -4,6 +4,12 @@ This guide provides instructions for upgrading to specific versions of Cosmos SD
## [Unreleased]
### Database configuration
Cleveldb, Boltdb and BadgerDB are not supported anymore. To migrate from a unsupported database to a supported database please use the database migration tool
<!-- TODO: write data base migration tool -->
### Protobuf
The SDK is in the process of removing all `gogoproto` annotations.

View File

@ -36,7 +36,7 @@ func Cmd(appCreator servertypes.AppCreator) *cobra.Command {
custom: allow pruning options to be manually specified through 'pruning-keep-recent'.
besides pruning options, database home directory and database backend type should also be specified via flags
'--home' and '--app-db-backend'.
valid app-db-backend type includes 'goleveldb', 'cleveldb', 'rocksdb', 'boltdb', and 'badgerdb'.
valid app-db-backend type includes 'goleveldb', 'rocksdb', 'pebbledb'.
`,
Example: "prune --home './' --app-db-backend 'goleveldb' --pruning 'custom' --pruning-keep-recent 100",
RunE: func(cmd *cobra.Command, _ []string) error {

View File

@ -373,6 +373,12 @@ func GetAppDBBackend(opts types.AppOptions) dbm.BackendType {
if len(rv) == 0 {
rv = cast.ToString(opts.Get("db-backend"))
}
// Cosmos SDK has migrated to cosmos-db which does not support all the backends which tm-db supported
if rv == "cleveldb" || rv == "badgerdb" || rv == "boltdb" {
panic(fmt.Sprintf("invalid app-db-backend %q, use %q, %q, %q instead", rv, dbm.GoLevelDBBackend, dbm.PebbleDBBackend, dbm.RocksDBBackend))
}
if len(rv) != 0 {
return dbm.BackendType(rv)
}