From 0a2429b467f3b0a7e6b395ef9ddde386c45bdc74 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 6 Apr 2022 20:04:39 +0100 Subject: [PATCH] Fix DI of `PubSub` in markets by binding dependencies it needs Bind drand and bootstrap peers config so that `PubSub` instantiated by `ConfigCommon` has all the dependencies it needs when `PubSub` instance is needed in markets. In ths case, the instance is needed by the index provider engine to announce new indexing advertisements. --- node/builder_miner.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node/builder_miner.go b/node/builder_miner.go index d24beff80..ad2b74f3e 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -75,6 +75,11 @@ func ConfigStorageMiner(c interface{}) Option { enableLibp2pNode := cfg.Subsystems.EnableMarkets // we enable libp2p nodes if the storage market subsystem is enabled, otherwise we don't return Options( + + // Needed to instantiate pubsub used by index provider via ConfigCommon + Override(new(dtypes.DrandSchedule), modules.BuiltinDrandConfig), + Override(new(dtypes.BootstrapPeers), modules.BuiltinBootstrap), + Override(new(dtypes.DrandBootstrap), modules.DrandBootstrap), ConfigCommon(&cfg.Common, enableLibp2pNode), Override(CheckFDLimit, modules.CheckFdLimit(build.MinerFDLimit)), // recommend at least 100k FD limit to miners