From 53b7f3950a9325b61cfb7ea442e0691395f4be5f Mon Sep 17 00:00:00 2001 From: miiu Date: Wed, 10 Jul 2024 13:27:22 +0300 Subject: [PATCH 1/2] small fix --- pkg/facade/simulatorFacade.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/facade/simulatorFacade.go b/pkg/facade/simulatorFacade.go index 60f3dde..385e7bf 100644 --- a/pkg/facade/simulatorFacade.go +++ b/pkg/facade/simulatorFacade.go @@ -17,7 +17,7 @@ import ( const ( errMsgAccountNotFound = "account was not found" - maxNumOfBlockToGenerateUntilTxProcessed = 10 + maxNumOfBlockToGenerateUntilTxProcessed = 20 ) type simulatorFacade struct { From 5370e9c9283ad168c1699a0eebf3ee20afdbbfc0 Mon Sep 17 00:00:00 2001 From: miiu Date: Sat, 13 Jul 2024 14:33:22 +0300 Subject: [PATCH 2/2] path where to save log file --- cmd/chainsimulator/flags.go | 5 +++++ cmd/chainsimulator/main.go | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/chainsimulator/flags.go b/cmd/chainsimulator/flags.go index 42ce5ec..4177d1e 100644 --- a/cmd/chainsimulator/flags.go +++ b/cmd/chainsimulator/flags.go @@ -51,6 +51,11 @@ var ( Usage: "The path to proxy configs", Value: "./config/proxy/config", } + pathWhereToSaveLogs = cli.StringFlag{ + Name: "path-log-save", + Usage: "The path where to save logs", + Value: "./", + } startTime = cli.Int64Flag{ Name: "start-time", Usage: "The start time of the chain", diff --git a/cmd/chainsimulator/main.go b/cmd/chainsimulator/main.go index d22c0dc..7749a5f 100644 --- a/cmd/chainsimulator/main.go +++ b/cmd/chainsimulator/main.go @@ -82,6 +82,7 @@ func main() { blockTimeInMs, skipConfigsDownload, fetchConfigsAndClose, + pathWhereToSaveLogs, } app.Authors = []cli.Author{ @@ -300,14 +301,9 @@ func initializeLogger(ctx *cli.Context, cfg config.Config) (closing.Closer, erro return nil, nil } - workingDir, err := os.Getwd() - if err != nil { - log.LogIfError(err) - workingDir = "" - } - + pathLogsSave := ctx.GlobalString(pathWhereToSaveLogs.Name) fileLogging, err := file.NewFileLogging(file.ArgsFileLogging{ - WorkingDir: workingDir, + WorkingDir: pathLogsSave, DefaultLogsPath: cfg.Config.Logs.LogsPath, LogFilePrefix: cfg.Config.Logs.LogFilePrefix, })