From 54a55ad027e8e0e10ffcb8457443cb83f0c97c23 Mon Sep 17 00:00:00 2001 From: Vritra4 Date: Mon, 29 Apr 2024 17:39:32 +0900 Subject: [PATCH 1/2] fix config --- config/config.go | 8 +------- config/types.go | 4 ---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/config/config.go b/config/config.go index 28de94f..c212bcf 100644 --- a/config/config.go +++ b/config/config.go @@ -25,7 +25,6 @@ func NewConfig(appOpts servertypes.AppOptions) (*IndexerConfig, error) { return cfg, nil } cfg.CacheSize = cast.ToUint(appOpts.Get(flagIndexerCacheSize)) - cfg.L1ChainId = cast.ToString(appOpts.Get(flagL1ChainId)) cfg.BackendConfig = viper.New() err := cfg.BackendConfig.MergeConfigMap(cast.ToStringMap(appOpts.Get(flagIndexerBackend))) @@ -47,10 +46,6 @@ func (c IndexerConfig) Validate() error { return fmt.Errorf("cache size must be greater than 0") } - if c.L1ChainId == "" { - return fmt.Errorf("l1 chain id must be set") - } - if c.BackendConfig == nil { return fmt.Errorf("backend config must be set") } @@ -64,9 +59,8 @@ func (c IndexerConfig) IsEnabled() bool { func DefaultConfig() IndexerConfig { return IndexerConfig{ - Enable: false, + Enable: true, CacheSize: 1_000_000, - L1ChainId: "", BackendConfig: store.DefaultConfig(), } } diff --git a/config/types.go b/config/types.go index da938ee..342a53f 100644 --- a/config/types.go +++ b/config/types.go @@ -7,7 +7,6 @@ import ( type IndexerConfig struct { Enable bool `mapstructure:"indexer.enable"` CacheSize uint `mapstructure:"indexer.cache-size"` - L1ChainId string `mapstructure:"indexer.l1-chain-id"` BackendConfig *viper.Viper `mapstructure:"indexer.backend"` } @@ -24,9 +23,6 @@ enable = {{ .IndexerConfig.Enable }} # CacheSize defines the size of the cache. cache-size = {{ .IndexerConfig.CacheSize }} -# l1-chain-id defines the chain id of the l1 chain. -l1-chain-id = "{{ .IndexerConfig.L1ChainId }}" - # Backend defines the type of the backend store and its options. # It should have a key-value pair named 'type', and the value should exist in store supported by cosmos-db. # supported type: "goleveldb" only in current From 136177dbec0c27308ac687684e976a8c97186a71 Mon Sep 17 00:00:00 2001 From: Vritra4 Date: Mon, 29 Apr 2024 17:41:47 +0900 Subject: [PATCH 2/2] chore --- README.md | 18 ------------------ config/config.go | 1 - 2 files changed, 19 deletions(-) diff --git a/README.md b/README.md index bacc106..a4bb9bc 100644 --- a/README.md +++ b/README.md @@ -6,21 +6,3 @@ Indexer listens StreamingManager's stream and indices streamed data Registered submodules get abci Events(i.e. FinalizeBlock and Commit) and are allowed to CRUD indexer key-value storage. -### Configuration - -Default configuration will be set when the indexer is initialized. -But, to run your indexer properly, you have to set 2 configuration properties. - -* set indexer.enable to true in app.toml -* set indexer.l1-chain-id to the L1's chain id app.toml - -Here's example: -```toml -[indexer] -enable = true -l1-chain-id = "mahalo-2" - -#...other properties.. -``` - -Other properties are okay with default! \ No newline at end of file diff --git a/config/config.go b/config/config.go index c212bcf..41c0897 100644 --- a/config/config.go +++ b/config/config.go @@ -14,7 +14,6 @@ const ( flagIndexerEnable = "indexer.enable" flagIndexerBackend = "indexer.backend" flagIndexerCacheSize = "indexer.cache-size" - flagL1ChainId = "indexer.l1-chain-id" ) func NewConfig(appOpts servertypes.AppOptions) (*IndexerConfig, error) {