diff --git a/cmd/opera/launcher/launcher.go b/cmd/opera/launcher/launcher.go index c81100659..5cf6d0d4a 100644 --- a/cmd/opera/launcher/launcher.go +++ b/cmd/opera/launcher/launcher.go @@ -14,6 +14,7 @@ import ( "github.com/ethereum/go-ethereum/console/prompt" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" + gmetrics "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/discover/discfilter" "github.com/ethereum/go-ethereum/params" @@ -299,7 +300,10 @@ func makeNode(ctx *cli.Context, cfg *config, genesisStore *genesisstore.Store) ( if genesisStore != nil { _ = genesisStore.Close() } - metrics.SetDataDir(cfg.Node.DataDir) + + if gmetrics.Enabled { + metrics.SetDataDir(cfg.Node.DataDir) + } memorizeDBPreset(cfg) // substitute default bootnodes if requested