From 941cfc5dc0998925163ebaa976653e5abf22670f Mon Sep 17 00:00:00 2001 From: jsvisa Date: Thu, 2 Nov 2023 23:29:07 +0800 Subject: [PATCH] cmd/geth: enable dev.alloc in ephemeral dir Signed-off-by: jsvisa --- cmd/utils/flags.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 7037c0305a..d7e6adb62c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -176,7 +176,7 @@ var ( } DeveloperAllocFlag = &cli.PathFlag{ Name: "dev.alloc", - Usage: "Genesis account allocation file to use in developer mode", + Usage: "Genesis account allocation file to use in developer mode (available only if datadir is not enabled)", TakesFile: true, Category: flags.DevCategory, } @@ -1884,10 +1884,10 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { log.Info("Using developer account", "address", developer.Address) var alloc core.GenesisAlloc + if ctx.IsSet(DeveloperAllocFlag.Name) && ctx.IsSet(DataDirFlag.Name) { + Fatalf("The %s flag is conflicted with %s flag, this flag can only be used with an ephemeral data directory", DeveloperAllocFlag.Name, DataDirFlag.Name) + } if allocPath := ctx.Path(DeveloperAllocFlag.Name); allocPath != "" { - if ctx.IsSet(DataDirFlag.Name) { - allocPath = stack.ResolvePath(allocPath) - } data, err := os.ReadFile(allocPath) if err != nil { Fatalf("Failed to read developer genesis alloc file: %v", err)