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 8212243 commit 030fa1e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
3 changes: 0 additions & 3 deletions cmd/opendb/run.sh

This file was deleted.

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ require (
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.26
github.com/go-kit/kit v0.12.0
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/holiman/uint256 v1.2.1
github.com/improbable-eng/grpc-web v0.15.0
github.com/linxGnu/grocksdb v1.8.6
github.com/onsi/ginkgo/v2 v2.9.1
github.com/onsi/gomega v1.27.4
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
github.com/rakyll/statik v0.1.7
github.com/rs/cors v1.8.3
github.com/spf13/cast v1.5.1
Expand Down Expand Up @@ -105,7 +108,6 @@ require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
Expand Down Expand Up @@ -153,7 +155,6 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.8.6 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -170,7 +171,6 @@ require (
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
Expand Down
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 030fa1e

Please sign in to comment.