diff --git a/CHANGELOG.md b/CHANGELOG.md index 1185006..8610230 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Operators, you should copy/paste content of this content straight to your projec If you were at `firehose-core` version `1.0.0` and are bumping to `1.1.0`, you should copy the content between those 2 version to your own repository, replacing placeholder value `fire{chain}` with your chain's own binary. +## v1.4.2 (Unreleased) + +* Fix parsing of flag 'common-index-block-sizes' from yaml config file + ## v1.4.1 ### Substreams bumped to v1.6.1 diff --git a/storage.go b/storage.go index 0d6808b..4af5f3a 100644 --- a/storage.go +++ b/storage.go @@ -3,6 +3,8 @@ package firecore import ( "context" "fmt" + "strconv" + "strings" "github.com/spf13/viper" "github.com/streamingfast/dstore" @@ -54,7 +56,17 @@ func GetIndexStore(dataDir string) (indexStore dstore.Store, possibleIndexSizes indexStore = s } - for _, size := range viper.GetIntSlice("common-index-block-sizes") { + sizes := viper.GetIntSlice("common-index-block-sizes") + if len(sizes) == 0 { + // viper doesn't parse ints from yaml file correctly + for _, k := range strings.Split(viper.GetString("common-index-block-sizes"), ",") { + if asInt, _err := strconv.ParseInt(k, 10, 64); _err == nil { + sizes = append(sizes, int(asInt)) + } + } + + } + for _, size := range sizes { if size < 0 { return nil, nil, fmt.Errorf("invalid negative size for common-index-block-sizes: %d", size) }