rename cfg.Subsystems.EnableStorageMarket to EnableMarkets

This commit is contained in:
Anton Evangelatov 2021-07-12 12:12:29 +02:00
parent 056136ef5a
commit 4bc9fa04ba
8 changed files with 11 additions and 11 deletions

View File

@ -95,7 +95,7 @@ var serviceCmd = &cli.Command{
} }
if err := restore(ctx, cctx, func(cfg *config.StorageMiner) error { if err := restore(ctx, cctx, func(cfg *config.StorageMiner) error {
cfg.Subsystems.EnableStorageMarket = cctx.Bool("enable-market") cfg.Subsystems.EnableMarkets = cctx.Bool("enable-market")
cfg.Subsystems.EnableMining = false cfg.Subsystems.EnableMining = false
cfg.Subsystems.EnableSealing = false cfg.Subsystems.EnableSealing = false
cfg.Subsystems.EnableSectorStorage = false cfg.Subsystems.EnableSectorStorage = false

View File

@ -132,7 +132,7 @@ var runCmd = &cli.Command{
return xerrors.Errorf("invalid config for repo, got: %T", c) return xerrors.Errorf("invalid config for repo, got: %T", c)
} }
bootstrapLibP2P := cfg.Subsystems.EnableStorageMarket bootstrapLibP2P := cfg.Subsystems.EnableMarkets
err = lr.Close() err = lr.Close()
if err != nil { if err != nil {

View File

@ -424,7 +424,7 @@ func (n *Ensemble) Start() *Ensemble {
n.t.Fatalf("invalid config from repo, got: %T", c) n.t.Fatalf("invalid config from repo, got: %T", c)
} }
cfg.Common.API.RemoteListenAddress = m.RemoteListener.Addr().String() cfg.Common.API.RemoteListenAddress = m.RemoteListener.Addr().String()
cfg.Subsystems.EnableStorageMarket = m.options.subsystems.Has(SStorageMarket) cfg.Subsystems.EnableMarkets = m.options.subsystems.Has(SMarkets)
cfg.Subsystems.EnableMining = m.options.subsystems.Has(SMining) cfg.Subsystems.EnableMining = m.options.subsystems.Has(SMining)
cfg.Subsystems.EnableSealing = m.options.subsystems.Has(SSealing) cfg.Subsystems.EnableSealing = m.options.subsystems.Has(SSealing)
cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage) cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage)

View File

@ -38,7 +38,7 @@ func EnsembleWithMinerAndMarketNodes(t *testing.T, opts ...interface{}) (*TestFu
ens := NewEnsemble(t, eopts...).FullNode(&fullnode, nopts...).Miner(&main, &fullnode, mainNodeOpts...).Start() ens := NewEnsemble(t, eopts...).FullNode(&fullnode, nopts...).Miner(&main, &fullnode, mainNodeOpts...).Start()
ens.BeginMining(blockTime) ens.BeginMining(blockTime)
marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SStorageMarket)} marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SMarkets)}
marketNodeOpts = append(marketNodeOpts, nopts...) marketNodeOpts = append(marketNodeOpts, nopts...)
ens.Miner(&market, &fullnode, marketNodeOpts...).Start().Connect(market, fullnode) ens.Miner(&market, &fullnode, marketNodeOpts...).Start().Connect(market, fullnode)

View File

@ -31,7 +31,7 @@ import (
type MinerSubsystem int type MinerSubsystem int
const ( const (
SStorageMarket MinerSubsystem = 1 << iota SMarkets MinerSubsystem = 1 << iota
SMining SMining
SSealing SSealing
SSectorStorage SSectorStorage

View File

@ -49,7 +49,7 @@ type NodeOpt func(opts *nodeOpts) error
func WithAllSubsystems() NodeOpt { func WithAllSubsystems() NodeOpt {
return func(opts *nodeOpts) error { return func(opts *nodeOpts) error {
opts.subsystems = opts.subsystems.Add(SStorageMarket) opts.subsystems = opts.subsystems.Add(SMarkets)
opts.subsystems = opts.subsystems.Add(SMining) opts.subsystems = opts.subsystems.Add(SMining)
opts.subsystems = opts.subsystems.Add(SSealing) opts.subsystems = opts.subsystems.Add(SSealing)
opts.subsystems = opts.subsystems.Add(SSectorStorage) opts.subsystems = opts.subsystems.Add(SSectorStorage)

View File

@ -67,7 +67,7 @@ func ConfigStorageMiner(c interface{}) Option {
return Error(xerrors.New("retrieval pricing policy must be either default or external")) return Error(xerrors.New("retrieval pricing policy must be either default or external"))
} }
enableLibp2pNode := cfg.Subsystems.EnableStorageMarket // we enable libp2p nodes if the storage market subsystem is enabled, otherwise we don't enableLibp2pNode := cfg.Subsystems.EnableMarkets // we enable libp2p nodes if the storage market subsystem is enabled, otherwise we don't
return Options( return Options(
ConfigCommon(&cfg.Common, enableLibp2pNode), ConfigCommon(&cfg.Common, enableLibp2pNode),
@ -127,7 +127,7 @@ func ConfigStorageMiner(c interface{}) Option {
Override(new(stores.SectorIndex), From(new(modules.MinerSealingService))), Override(new(stores.SectorIndex), From(new(modules.MinerSealingService))),
), ),
If(cfg.Subsystems.EnableStorageMarket, If(cfg.Subsystems.EnableMarkets,
// Markets // Markets
Override(new(dtypes.StagingMultiDstore), modules.StagingMultiDatastore), Override(new(dtypes.StagingMultiDstore), modules.StagingMultiDatastore),
Override(new(dtypes.StagingBlockstore), modules.StagingBlockstore), Override(new(dtypes.StagingBlockstore), modules.StagingBlockstore),
@ -209,7 +209,7 @@ func StorageMiner(out *api.StorageMiner, subsystemsCfg config.MinerSubsystemConf
func(s *Settings) error { func(s *Settings) error {
s.nodeType = repo.StorageMiner s.nodeType = repo.StorageMiner
s.enableLibp2pNode = subsystemsCfg.EnableStorageMarket s.enableLibp2pNode = subsystemsCfg.EnableMarkets
return nil return nil
}, },

View File

@ -62,7 +62,7 @@ type MinerSubsystemConfig struct {
EnableMining bool EnableMining bool
EnableSealing bool EnableSealing bool
EnableSectorStorage bool EnableSectorStorage bool
EnableStorageMarket bool EnableMarkets bool
SealerApiInfo string // if EnableSealing == false SealerApiInfo string // if EnableSealing == false
SectorIndexApiInfo string // if EnableSectorStorage == false SectorIndexApiInfo string // if EnableSectorStorage == false
@ -400,7 +400,7 @@ func DefaultStorageMiner() *StorageMiner {
EnableMining: true, EnableMining: true,
EnableSealing: true, EnableSealing: true,
EnableSectorStorage: true, EnableSectorStorage: true,
EnableStorageMarket: true, EnableMarkets: true,
}, },
Fees: MinerFeeConfig{ Fees: MinerFeeConfig{