From 4bc9fa04ba4482968218113371a7f1c4188c8d94 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 12 Jul 2021 12:12:29 +0200 Subject: [PATCH] rename cfg.Subsystems.EnableStorageMarket to EnableMarkets --- cmd/lotus-storage-miner/init_service.go | 2 +- cmd/lotus-storage-miner/run.go | 2 +- itests/kit/ensemble.go | 2 +- itests/kit/ensemble_presets.go | 2 +- itests/kit/node_miner.go | 2 +- itests/kit/node_opts.go | 2 +- node/builder_miner.go | 6 +++--- node/config/def.go | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/lotus-storage-miner/init_service.go b/cmd/lotus-storage-miner/init_service.go index 9ed0707f0..33bffafd4 100644 --- a/cmd/lotus-storage-miner/init_service.go +++ b/cmd/lotus-storage-miner/init_service.go @@ -95,7 +95,7 @@ var serviceCmd = &cli.Command{ } 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.EnableSealing = false cfg.Subsystems.EnableSectorStorage = false diff --git a/cmd/lotus-storage-miner/run.go b/cmd/lotus-storage-miner/run.go index cb21ae0e9..f276f319c 100644 --- a/cmd/lotus-storage-miner/run.go +++ b/cmd/lotus-storage-miner/run.go @@ -132,7 +132,7 @@ var runCmd = &cli.Command{ return xerrors.Errorf("invalid config for repo, got: %T", c) } - bootstrapLibP2P := cfg.Subsystems.EnableStorageMarket + bootstrapLibP2P := cfg.Subsystems.EnableMarkets err = lr.Close() if err != nil { diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 1651193f7..4cce3cf9e 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -424,7 +424,7 @@ func (n *Ensemble) Start() *Ensemble { n.t.Fatalf("invalid config from repo, got: %T", c) } 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.EnableSealing = m.options.subsystems.Has(SSealing) cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage) diff --git a/itests/kit/ensemble_presets.go b/itests/kit/ensemble_presets.go index 111509305..b7ff80aa1 100644 --- a/itests/kit/ensemble_presets.go +++ b/itests/kit/ensemble_presets.go @@ -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.BeginMining(blockTime) - marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SStorageMarket)} + marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SMarkets)} marketNodeOpts = append(marketNodeOpts, nopts...) ens.Miner(&market, &fullnode, marketNodeOpts...).Start().Connect(market, fullnode) diff --git a/itests/kit/node_miner.go b/itests/kit/node_miner.go index 903102f00..ff406629c 100644 --- a/itests/kit/node_miner.go +++ b/itests/kit/node_miner.go @@ -31,7 +31,7 @@ import ( type MinerSubsystem int const ( - SStorageMarket MinerSubsystem = 1 << iota + SMarkets MinerSubsystem = 1 << iota SMining SSealing SSectorStorage diff --git a/itests/kit/node_opts.go b/itests/kit/node_opts.go index 20723dc1e..87707aa16 100644 --- a/itests/kit/node_opts.go +++ b/itests/kit/node_opts.go @@ -49,7 +49,7 @@ type NodeOpt func(opts *nodeOpts) error func WithAllSubsystems() NodeOpt { 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(SSealing) opts.subsystems = opts.subsystems.Add(SSectorStorage) diff --git a/node/builder_miner.go b/node/builder_miner.go index db5c9b60b..0c0f9d15a 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -67,7 +67,7 @@ func ConfigStorageMiner(c interface{}) Option { 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( ConfigCommon(&cfg.Common, enableLibp2pNode), @@ -127,7 +127,7 @@ func ConfigStorageMiner(c interface{}) Option { Override(new(stores.SectorIndex), From(new(modules.MinerSealingService))), ), - If(cfg.Subsystems.EnableStorageMarket, + If(cfg.Subsystems.EnableMarkets, // Markets Override(new(dtypes.StagingMultiDstore), modules.StagingMultiDatastore), Override(new(dtypes.StagingBlockstore), modules.StagingBlockstore), @@ -209,7 +209,7 @@ func StorageMiner(out *api.StorageMiner, subsystemsCfg config.MinerSubsystemConf func(s *Settings) error { s.nodeType = repo.StorageMiner - s.enableLibp2pNode = subsystemsCfg.EnableStorageMarket + s.enableLibp2pNode = subsystemsCfg.EnableMarkets return nil }, diff --git a/node/config/def.go b/node/config/def.go index 4f918cc50..14b90cc8e 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -62,7 +62,7 @@ type MinerSubsystemConfig struct { EnableMining bool EnableSealing bool EnableSectorStorage bool - EnableStorageMarket bool + EnableMarkets bool SealerApiInfo string // if EnableSealing == false SectorIndexApiInfo string // if EnableSectorStorage == false @@ -400,7 +400,7 @@ func DefaultStorageMiner() *StorageMiner { EnableMining: true, EnableSealing: true, EnableSectorStorage: true, - EnableStorageMarket: true, + EnableMarkets: true, }, Fees: MinerFeeConfig{