Skip to content

Commit

Permalink
Tmp Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Jun 24, 2024
1 parent 81c3333 commit ded6cc6
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,32 @@ func startStandAlone(ctx *server.Context, opts StartOptions) error {
return server.WaitForQuitSignals()
}

// DefaultDBProvider returns a database using the DBBackend and DBDir
// specified in the ctx.Config.
func DefaultDBProvider(ctx *node.DBContext) (dbm.DB, error) {
// appOpts types.AppOptions, home string, backendType dbm.BackendType
// opendb.OpenDB()

dbType := dbm.BackendType(ctx.Config.DBBackend)

fmt.Printf("############################## Stack ##############################\n")
fmt.Printf("ctx.ID : name : %v\n", ctx.ID)
fmt.Printf("dbType : backend: %v\n", dbType)
fmt.Printf("ctx.Config.DBDir(): dir : %v\n", ctx.Config.DBDir())

fmt.Printf("RootDir : %v\n", ctx.Config.RootDir)
fmt.Printf("DBPath : %v\n", ctx.Config.DBPath)
fmt.Printf("############################## Stack ##############################\n")

// name string, backend BackendType, dir string

// ctx.ID : name : blockstore
// dbType : backend: rocksdb
// ctx.Config.DBDir(): dir : /root/.kava/data

return dbm.NewDB(ctx.ID, dbType, ctx.Config.DBDir())
}

// legacyAminoCdc is used for the legacy REST API
func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOptions) (err error) {
cfg := ctx.Config
Expand Down Expand Up @@ -385,7 +411,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt
nodeKey,
proxy.NewLocalClientCreator(app),
genDocProvider,
node.DefaultDBProvider,
DefaultDBProvider,
node.DefaultMetricsProvider(cfg.Instrumentation),
ctx.Logger.With("server", "node"),
)
Expand Down

0 comments on commit ded6cc6

Please sign in to comment.