Commit e77efb38 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #6994 from ethereum-optimism/08-23-feat_indexer_add_indexer_all_command

feat(indexer): add indexer all command
parents a9792032 cc93b709
...@@ -76,6 +76,18 @@ func runApi(ctx *cli.Context) error { ...@@ -76,6 +76,18 @@ func runApi(ctx *cli.Context) error {
return api.Listen(apiCtx, cfg.API.Port) return api.Listen(apiCtx, cfg.API.Port)
} }
func runAll(ctx *cli.Context) error {
// Run the indexer
go func() {
if err := runIndexer(ctx); err != nil {
log.NewLogger(log.ReadCLIConfig(ctx)).Error("Error running the indexer", "err", err)
}
}()
// Run the API and return its error, if any
return runApi(ctx)
}
func newCli(GitCommit string, GitDate string) *cli.App { func newCli(GitCommit string, GitDate string) *cli.App {
flags := []cli.Flag{ConfigFlag} flags := []cli.Flag{ConfigFlag}
flags = append(flags, log.CLIFlags("INDEXER")...) flags = append(flags, log.CLIFlags("INDEXER")...)
...@@ -104,6 +116,12 @@ func newCli(GitCommit string, GitDate string) *cli.App { ...@@ -104,6 +116,12 @@ func newCli(GitCommit string, GitDate string) *cli.App {
return nil return nil
}, },
}, },
{
Name: "all",
Flags: flags,
Description: "Runs both the api service and the indexing service",
Action: runAll,
},
}, },
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment