Set default index provider ingest config values

Set default values for index-provider ingest config.

Leave a TODO to use provider config APIs once defaults exposed.

Run `go mod tidy`
This commit is contained in:
Masih H. Derkani
2021-12-13 14:44:56 +00:00
parent 43cde484f4
commit 6b7b9793ab
3 changed files with 15 additions and 2 deletions
+10
View File
@@ -10,6 +10,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
ipconfig "github.com/filecoin-project/index-provider/config"
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/builtin"
@@ -224,6 +225,15 @@ func DefaultStorageMiner() *StorageMiner {
GCInterval: Duration(1 * time.Minute),
},
}
// TODO: Remove hardcoded defaults once provider library exposes them.
// See: https://github.com/filecoin-project/index-provider/issues/108
cfg.IndexerProvider.Ingest = ipconfig.Ingest{
LinkCacheSize: 1024,
LinkedChunkSize: 100,
PubSubTopic: "indexer/ingest",
}
cfg.Common.API.ListenAddress = "/ip4/127.0.0.1/tcp/2345/http"
cfg.Common.API.RemoteListenAddress = "127.0.0.1:2345"
return cfg
+5
View File
@@ -52,3 +52,8 @@ func TestDefaultMinerRoundtrip(t *testing.T) {
require.True(t, reflect.DeepEqual(c, c2))
}
func TestDefaultStorageMiner_SetsIndexIngestTopic(t *testing.T) {
subject := DefaultStorageMiner()
require.Equal(t, "indexer/ingest", subject.IndexerProvider.PubSubTopic)
}