add RuntimeSubsystems API method; use it in lotus-miner info

This commit is contained in:
Anton Evangelatov
2021-07-28 16:02:05 +03:00
parent 9d0cc2c9d7
commit de4a847078
12 changed files with 410 additions and 280 deletions
+17
View File
@@ -1007,3 +1007,20 @@ func mutateCfg(r repo.LockedRepo, mutator func(*config.StorageMiner)) error {
return multierr.Combine(typeErr, setConfigErr)
}
func AddMinerSubsystems(cfg config.MinerSubsystemConfig) (res api.MinerSubsystems) {
if cfg.EnableMining {
res = append(res, api.MiningSubsystem)
}
if cfg.EnableSealing {
res = append(res, api.SealingSubsystem)
}
if cfg.EnableSectorStorage {
res = append(res, api.SectorStorageSubsystem)
}
if cfg.EnableMarkets {
res = append(res, api.MarketsSubsystem)
}
return
}