Skip to content

Commit

Permalink
Merge pull request #964 from maticnetwork/pebble
Browse files Browse the repository at this point in the history
internal/cli: add db.engine flag
  • Loading branch information
anshalshukla committed Aug 17, 2023
2 parents 58729e5 + 18dd5dc commit d0f0cef
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions builder/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ chain = "mainnet"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
db.engine = "leveldb"
# keystore = "/var/lib/bor/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
1 change: 1 addition & 0 deletions docs/cli/example_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ verbosity = 3 # Logging verbosity for the server (5=trace|4=de
vmdebug = false # Record information useful for VM and contract debugging
datadir = "var/lib/bor" # Path of the data directory to store information
ancient = "" # Data directory for ancient chain segments (default = inside chaindata)
db.engine = "leveldb" # Used to select leveldb or pebble as database (default = leveldb)
keystore = "" # Path of the directory where keystores are located
"rpc.batchlimit" = 100 # Maximum number of messages in a batch (default=100, use 0 for no limits)
"rpc.returndatalimit" = 100000 # Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits)
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The ```bor server``` command runs the Bor client.

- ```datadir.ancient```: Data directory for ancient chain segments (default = inside chaindata)

- ```db.engine```: Backing database implementation to use ('leveldb' or 'pebble') (default: leveldb)

- ```keystore```: Path of the directory where keystores are located

- ```rpc.batchlimit```: Maximum number of messages in a batch (default=100, use 0 for no limits) (default: 100)
Expand Down
5 changes: 5 additions & 0 deletions internal/cli/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ type Config struct {
// Ancient is the directory to store the state in
Ancient string `hcl:"ancient,optional" toml:"ancient,optional"`

// DBEngine is used to select leveldb or pebble as database
DBEngine string `hcl:"dbengine,optional" toml:"dbengine,optional"`

// KeyStoreDir is the directory to store keystores
KeyStoreDir string `hcl:"keystore,optional" toml:"keystore,optional"`

Expand Down Expand Up @@ -592,6 +595,7 @@ func DefaultConfig() *Config {
EnablePreimageRecording: false,
DataDir: DefaultDataDir(),
Ancient: "",
DBEngine: "leveldb",
Logging: &LoggingConfig{
Vmodule: "",
Json: false,
Expand Down Expand Up @@ -1278,6 +1282,7 @@ func (c *Config) buildNode() (*node.Config, error) {
cfg := &node.Config{
Name: clientIdentifier,
DataDir: c.DataDir,
DBEngine: c.DBEngine,
KeyStoreDir: c.KeyStoreDir,
UseLightweightKDF: c.Accounts.UseLightweightKDF,
InsecureUnlockAllowed: c.Accounts.AllowInsecureUnlock,
Expand Down
6 changes: 6 additions & 0 deletions internal/cli/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ func (c *Command) Flags() *flagset.Flagset {
Value: &c.cliConfig.Ancient,
Default: c.cliConfig.Ancient,
})
f.StringFlag(&flagset.StringFlag{
Name: "db.engine",
Usage: "Backing database implementation to use ('leveldb' or 'pebble')",
Value: &c.cliConfig.DBEngine,
Default: c.cliConfig.DBEngine,
})
f.StringFlag(&flagset.StringFlag{
Name: "keystore",
Usage: "Path of the directory where keystores are located",
Expand Down
1 change: 1 addition & 0 deletions packaging/templates/mainnet-v1/archive/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mainnet"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = ""
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mainnet"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = ""
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chain = "mainnet"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = "$BOR_DIR/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chain = "mainnet"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = "$BOR_DIR/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
1 change: 1 addition & 0 deletions packaging/templates/testnet-v4/archive/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mumbai"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = ""
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mumbai"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = ""
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chain = "mumbai"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = "$BOR_DIR/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chain = "mumbai"
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# db.engine = "leveldb"
# keystore = "$BOR_DIR/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
Expand Down

0 comments on commit d0f0cef

Please sign in to comment.