mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/geth: enable dev.alloc in ephemeral dir
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
893e6823e8
commit
941cfc5dc0
1 changed files with 4 additions and 4 deletions
|
|
@ -176,7 +176,7 @@ var (
|
||||||
}
|
}
|
||||||
DeveloperAllocFlag = &cli.PathFlag{
|
DeveloperAllocFlag = &cli.PathFlag{
|
||||||
Name: "dev.alloc",
|
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,
|
TakesFile: true,
|
||||||
Category: flags.DevCategory,
|
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)
|
log.Info("Using developer account", "address", developer.Address)
|
||||||
|
|
||||||
var alloc core.GenesisAlloc
|
var alloc core.GenesisAlloc
|
||||||
if allocPath := ctx.Path(DeveloperAllocFlag.Name); allocPath != "" {
|
if ctx.IsSet(DeveloperAllocFlag.Name) && ctx.IsSet(DataDirFlag.Name) {
|
||||||
if 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)
|
||||||
allocPath = stack.ResolvePath(allocPath)
|
|
||||||
}
|
}
|
||||||
|
if allocPath := ctx.Path(DeveloperAllocFlag.Name); allocPath != "" {
|
||||||
data, err := os.ReadFile(allocPath)
|
data, err := os.ReadFile(allocPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Failed to read developer genesis alloc file: %v", err)
|
Fatalf("Failed to read developer genesis alloc file: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue