diff --git a/cmd/chainsimulator/flags.go b/cmd/chainsimulator/flags.go index 6976a9e..9cbca96 100644 --- a/cmd/chainsimulator/flags.go +++ b/cmd/chainsimulator/flags.go @@ -127,6 +127,10 @@ var ( Name: "skip-configs-download", Usage: "The flag is used to specify whether to skip downloading configs", } + fetchConfigsAndClose = cli.BoolFlag{ + Name: "fetch-configs-and-close", + Usage: "This flag is used to specify to fetch all configs and close the chain simulator after", + } ) func applyFlags(ctx *cli.Context, cfg *config.Config) { diff --git a/cmd/chainsimulator/main.go b/cmd/chainsimulator/main.go index e14b6fa..c536fbc 100644 --- a/cmd/chainsimulator/main.go +++ b/cmd/chainsimulator/main.go @@ -81,6 +81,7 @@ func main() { autoGenerateBlocks, blockTimeInMs, skipConfigsDownload, + fetchConfigsAndClose, } app.Authors = []cli.Author{ @@ -123,10 +124,14 @@ func startChainSimulator(ctx *cli.Context) error { skipDownload := ctx.GlobalBool(skipConfigsDownload.Name) nodeConfigs := ctx.GlobalString(pathToNodeConfigs.Name) proxyConfigs := ctx.GlobalString(pathToProxyConfigs.Name) + fetchConfigsAndCloseBool := ctx.GlobalBool(fetchConfigsAndClose.Name) err = fetchConfigs(skipDownload, cfg, nodeConfigs, proxyConfigs) if err != nil { return fmt.Errorf("%w while fetching configs", err) } + if fetchConfigsAndCloseBool { + return nil + } bypassTxsSignature := ctx.GlobalBool(bypassTransactionsSignature.Name) log.Warn("signature", "bypass", bypassTxsSignature)