pass Subsystems to StorageMiner option; add enableLibp2p bool in Settings

This commit is contained in:
Anton Evangelatov
2021-07-07 13:56:37 +02:00
parent caa366bc6a
commit 6b014f57e5
10 changed files with 21 additions and 46 deletions
+2 -1
View File
@@ -201,7 +201,7 @@ func ConfigStorageMiner(c interface{}) Option {
)
}
func StorageMiner(out *api.StorageMiner) Option {
func StorageMiner(out *api.StorageMiner, subsystemsCfg config.MinerSubsystemConfig) Option {
return Options(
ApplyIf(func(s *Settings) bool { return s.Config },
Error(errors.New("the StorageMiner option must be set before Config option")),
@@ -209,6 +209,7 @@ func StorageMiner(out *api.StorageMiner) Option {
func(s *Settings) error {
s.nodeType = repo.StorageMiner
s.enableLibp2pNode = subsystemsCfg.EnableStorageMarket
return nil
},