mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
don't try to create default datadir (#8398)
for https://github.com/ledgerwatch/erigon/issues/8396
This commit is contained in:
parent
d90572b786
commit
f7adc2374d
@ -1195,11 +1195,10 @@ func SetNodeConfigCobra(cmd *cobra.Command, cfg *nodecfg.Config) {
|
||||
|
||||
func setDataDir(ctx *cli.Context, cfg *nodecfg.Config) {
|
||||
if ctx.IsSet(DataDirFlag.Name) {
|
||||
cfg.Dirs.DataDir = ctx.String(DataDirFlag.Name)
|
||||
cfg.Dirs = datadir.New(ctx.String(DataDirFlag.Name))
|
||||
} else {
|
||||
cfg.Dirs.DataDir = paths.DataDirForNetwork(cfg.Dirs.DataDir, ctx.String(ChainFlag.Name))
|
||||
cfg.Dirs = datadir.New(paths.DataDirForNetwork(paths.DefaultDataDir(), ctx.String(ChainFlag.Name)))
|
||||
}
|
||||
cfg.Dirs = datadir.New(cfg.Dirs.DataDir)
|
||||
cfg.MdbxPageSize = flags.DBPageSizeFlagUnmarshal(ctx, DbPageSizeFlag.Name, DbPageSizeFlag.Usage)
|
||||
if err := cfg.MdbxDBSizeLimit.UnmarshalText([]byte(ctx.String(DbSizeLimitFlag.Name))); err != nil {
|
||||
panic(err)
|
||||
@ -1220,13 +1219,10 @@ func setDataDirCobra(f *pflag.FlagSet, cfg *nodecfg.Config) {
|
||||
panic(err)
|
||||
}
|
||||
if dirname != "" {
|
||||
cfg.Dirs.DataDir = dirname
|
||||
cfg.Dirs = datadir.New(dirname)
|
||||
} else {
|
||||
cfg.Dirs.DataDir = paths.DataDirForNetwork(cfg.Dirs.DataDir, chain)
|
||||
cfg.Dirs = datadir.New(paths.DataDirForNetwork(paths.DefaultDataDir(), chain))
|
||||
}
|
||||
|
||||
cfg.Dirs.DataDir = paths.DataDirForNetwork(cfg.Dirs.DataDir, chain)
|
||||
cfg.Dirs = datadir.New(cfg.Dirs.DataDir)
|
||||
}
|
||||
|
||||
func setGPO(ctx *cli.Context, cfg *gaspricecfg.Config) {
|
||||
|
@ -17,10 +17,8 @@
|
||||
package nodecfg
|
||||
|
||||
import (
|
||||
"github.com/ledgerwatch/erigon-lib/common/datadir"
|
||||
"github.com/ledgerwatch/erigon-lib/direct"
|
||||
|
||||
"github.com/ledgerwatch/erigon/common/paths"
|
||||
"github.com/ledgerwatch/erigon/p2p"
|
||||
"github.com/ledgerwatch/erigon/p2p/nat"
|
||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||
@ -40,7 +38,6 @@ const (
|
||||
|
||||
// DefaultConfig contains reasonable default settings.
|
||||
var DefaultConfig = Config{
|
||||
Dirs: datadir.New(paths.DefaultDataDir()),
|
||||
HTTPPort: DefaultHTTPPort,
|
||||
HTTPModules: []string{"net", "web3"},
|
||||
HTTPVirtualHosts: []string{"localhost"},
|
||||
|
Loading…
Reference in New Issue
Block a user