diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 20075c57b..b63a271b3 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -271,6 +271,16 @@ func main() { // prepare manipulates memory cache allowance and setups metric system. // This function should be called before launching devp2p stack. func prepare(ctx *cli.Context) { + if err := prepareSuaveDev(ctx); err != nil { + log.Error("failed to setup suave dev mode", "err", err) + os.Exit(1) + } + + if err := prepareSuaveNetworksRemapping(ctx); err != nil { + log.Error("failed to setup suave networks remapping", "err", err) + os.Exit(1) + } + // If we're running a known preset, log it for convenience. switch { case ctx.IsSet(utils.RinkebyFlag.Name): @@ -340,14 +350,6 @@ func geth(ctx *cli.Context) error { return fmt.Errorf("invalid command: %q", args[0]) } - if err := prepareSuaveDev(ctx); err != nil { - return fmt.Errorf("failed to setup suave development mode: %v", err) - } - - if err := prepareSuaveNetworksRemapping(ctx); err != nil { - return err - } - prepare(ctx) stack, backend := makeFullNode(ctx) defer stack.Close()