Skip to content

Commit

Permalink
node: enable indexer by default in all modes
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Mar 20, 2024
1 parent a75b688 commit a103503
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ func loadConfig() *config.Config {
flag.StringVar(&flagVochainCreateGenesis, "vochainCreateGenesis", "",
"create a genesis file for the vochain with validators and exit"+
" (syntax <dir>:<numValidators>)")
flag.Bool("vochainIndexerDisabled", false,
"disables the vochain indexer component")

// metrics
flag.Bool("metricsEnabled", false, "enable prometheus metrics")
Expand Down Expand Up @@ -296,6 +298,7 @@ func loadConfig() *config.Config {
}
// Note that these Config.Vochain fields aren't bound via viper.
// We could do that if we rename the flags, e.g. vochainIndexerArchiveURL.
conf.Vochain.Indexer.Enabled = !viper.GetBool("vochainIndexerDisabled")
conf.Vochain.Indexer.ArchiveURL = viper.GetString("archiveURL")
conf.Vochain.Network = viper.GetString("chain")

Expand Down Expand Up @@ -458,8 +461,6 @@ func main() {
conf.Mode == types.ModeSeed {
// set IsSeedNode to true if seed mode configured
conf.Vochain.IsSeedNode = types.ModeSeed == conf.Mode
// do we need indexer?
conf.Vochain.Indexer.Enabled = conf.Mode == types.ModeGateway
// offchainDataDownload is only needed for gateways
conf.Vochain.OffChainDataDownload = conf.Vochain.OffChainDataDownload &&
conf.Mode == types.ModeGateway
Expand Down

0 comments on commit a103503

Please sign in to comment.