diff options
author | Ferenc Szabo <frncmx@gmail.com> | 2018-11-23 08:32:34 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2018-11-23 08:32:34 +0800 |
commit | 76f5f662ccaf5190eb283ab8b5d607587e1ab8f9 (patch) | |
tree | b7416f8c64df1ec82bc879cf15fe102410fc7037 /cmd/utils/flags.go | |
parent | 6b2cc8950e55b1d93afb3c82bb1081cf931d62cf (diff) | |
download | dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.gz dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.bz2 dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.lz dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.xz dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.zst dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.zip |
cmd/swarm: FUSE do not require --ipcpath (#18112)
- Have `${DataDir}/bzzd.ipc` as IPC path default.
- Respect the `--datadir` flag.
- Keep only the global `--ipcpath` flag and drop the local `--ipcpath` flag
as flags might overwrite each other. (Note: before global `--ipcpath`
was ignored even if it was set)
fixes ethersphere#795
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r-- | cmd/utils/flags.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d7b698c7e..d0597c2f1 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -978,16 +978,7 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) { setWS(ctx, cfg) setNodeUserIdent(ctx, cfg) - switch { - case ctx.GlobalIsSet(DataDirFlag.Name): - cfg.DataDir = ctx.GlobalString(DataDirFlag.Name) - case ctx.GlobalBool(DeveloperFlag.Name): - cfg.DataDir = "" // unless explicitly requested, use memory databases - case ctx.GlobalBool(TestnetFlag.Name): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet") - case ctx.GlobalBool(RinkebyFlag.Name): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby") - } + setDataDir(ctx, cfg) if ctx.GlobalIsSet(KeyStoreDirFlag.Name) { cfg.KeyStoreDir = ctx.GlobalString(KeyStoreDirFlag.Name) @@ -1000,6 +991,19 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) { } } +func setDataDir(ctx *cli.Context, cfg *node.Config) { + switch { + case ctx.GlobalIsSet(DataDirFlag.Name): + cfg.DataDir = ctx.GlobalString(DataDirFlag.Name) + case ctx.GlobalBool(DeveloperFlag.Name): + cfg.DataDir = "" // unless explicitly requested, use memory databases + case ctx.GlobalBool(TestnetFlag.Name): + cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet") + case ctx.GlobalBool(RinkebyFlag.Name): + cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby") + } +} + func setGPO(ctx *cli.Context, cfg *gasprice.Config) { if ctx.GlobalIsSet(GpoBlocksFlag.Name) { cfg.Blocks = ctx.GlobalInt(GpoBlocksFlag.Name) |