Move keybase DB to ~/.basecoind/data (closes #644)

This commit is contained in:
Christopher Goes
2018-03-29 12:04:52 +02:00
parent 27d24610ab
commit bb66b852ef
4 changed files with 11 additions and 5 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ package keys
import (
"fmt"
"path/filepath"
"github.com/spf13/viper"
@@ -31,8 +32,8 @@ type KeyOutput struct {
// GetKeyBase initializes a keybase based on the configuration
func GetKeyBase() (keys.Keybase, error) {
if keybase == nil {
rootDir := viper.GetString(cli.HomeFlag)
db, err := dbm.NewGoLevelDB(KeyDBName, rootDir)
rootDir := filepath.Join(viper.GetString(cli.HomeFlag), ".basecoind")
db, err := dbm.NewGoLevelDB(KeyDBName, filepath.Join(rootDir, "data"))
if err != nil {
return nil, err
}
+2
View File
@@ -25,6 +25,7 @@ import (
ctypes "github.com/tendermint/tendermint/rpc/core/types"
tmrpc "github.com/tendermint/tendermint/rpc/lib/server"
tmtypes "github.com/tendermint/tendermint/types"
"github.com/tendermint/tmlibs/cli"
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"
@@ -294,6 +295,7 @@ func TestTxs(t *testing.T) {
// strt TM and the LCD in process, listening on their respective sockets
func startTMAndLCD() (*nm.Node, net.Listener, error) {
viper.Set(cli.HomeFlag, os.ExpandEnv("$HOME"))
kb, err := keys.GetKeyBase() // dbm.NewMemDB()) // :(
if err != nil {
return nil, nil, err