From 1c2bb7c8dc008a264c1a525ed6010b29bf034f3c Mon Sep 17 00:00:00 2001 From: millken Date: Mon, 16 Jan 2023 13:26:52 +0800 Subject: [PATCH 1/2] fix missing config MptrieLogPath --- config/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/config/config.go b/config/config.go index 352a06d276..e038f01f7c 100644 --- a/config/config.go +++ b/config/config.go @@ -129,6 +129,7 @@ type ( Log log.GlobalConfig `yaml:"log"` SubLogs map[string]log.GlobalConfig `yaml:"subLogs"` Genesis genesis.Genesis `yaml:"genesis"` + MptrieLogPath string `yaml:"mptrieLogPath"` } // Validate is the interface of validating the config From 414825ff333e3393abc6542da5f88e16c05f01ac Mon Sep 17 00:00:00 2001 From: millken Date: Tue, 17 Jan 2023 10:04:34 +0800 Subject: [PATCH 2/2] fix comments --- config/config.go | 2 +- server/main.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index e038f01f7c..4ec8db2719 100644 --- a/config/config.go +++ b/config/config.go @@ -110,6 +110,7 @@ type ( HTTPStatsPort int `yaml:"httpStatsPort"` StartSubChainInterval time.Duration `yaml:"startSubChainInterval"` SystemLogDBPath string `yaml:"systemLogDBPath"` + MptrieLogPath string `yaml:"mptrieLogPath"` } // Config is the root config struct, each package's config should be put as its sub struct @@ -129,7 +130,6 @@ type ( Log log.GlobalConfig `yaml:"log"` SubLogs map[string]log.GlobalConfig `yaml:"subLogs"` Genesis genesis.Genesis `yaml:"genesis"` - MptrieLogPath string `yaml:"mptrieLogPath"` } // Validate is the interface of validating the config diff --git a/server/main.go b/server/main.go index 7f0209a061..c880cc4745 100644 --- a/server/main.go +++ b/server/main.go @@ -140,8 +140,8 @@ func main() { livenessCancel() }() - if cfg.MptrieLogPath != "" { - if err = mptrie.OpenLogDB(cfg.MptrieLogPath); err != nil { + if cfg.System.MptrieLogPath != "" { + if err = mptrie.OpenLogDB(cfg.System.MptrieLogPath); err != nil { log.L().Fatal("Failed to open mptrie log DB.", zap.Error(err)) } defer func() {