Skip to content

Commit

Permalink
fetch configs and close
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 committed May 22, 2024
1 parent e4a20ec commit ac54fd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/chainsimulator/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions cmd/chainsimulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func main() {
autoGenerateBlocks,
blockTimeInMs,
skipConfigsDownload,
fetchConfigsAndClose,
}

app.Authors = []cli.Author{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ac54fd1

Please sign in to comment.