Skip to content

Commit

Permalink
Fix DI of PubSub in markets by binding dependencies it needs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
masih committed Apr 6, 2022
1 parent 7e7e88e commit f369d99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/builder_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f369d99

Please sign in to comment.