From a103503e3ed37577498a80d829e9e0237f221727 Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Tue, 19 Mar 2024 11:30:51 +0100 Subject: [PATCH] node: enable indexer by default in all modes --- cmd/node/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/node/main.go b/cmd/node/main.go index 0f5a21b6a..ee90e96f5 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -217,6 +217,8 @@ func loadConfig() *config.Config { flag.StringVar(&flagVochainCreateGenesis, "vochainCreateGenesis", "", "create a genesis file for the vochain with validators and exit"+ " (syntax :)") + flag.Bool("vochainIndexerDisabled", false, + "disables the vochain indexer component") // metrics flag.Bool("metricsEnabled", false, "enable prometheus metrics") @@ -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") @@ -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