diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 1651193f787..2bc0c88fff2 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -416,6 +416,27 @@ func (n *Ensemble) Start() *Ensemble { lr, err := r.Lock(repo.StorageMiner) require.NoError(n.t, err) + err = lr.SetConfig(func(raw interface{}) { + cfg := raw.(*config.StorageMiner) + cfg.Common.API.RemoteListenAddress = m.RemoteListener.Addr().String() + cfg.Subsystems.EnableStorageMarket = m.options.subsystems.Has(SStorageMarket) + cfg.Subsystems.EnableMining = m.options.subsystems.Has(SMining) + cfg.Subsystems.EnableSealing = m.options.subsystems.Has(SSealing) + cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage) + + if m.options.mainMiner != nil { + token, err := m.options.mainMiner.FullNode.AuthNew(ctx, api.AllPermissions) + require.NoError(n.t, err) + + cfg.Subsystems.SectorIndexApiInfo = fmt.Sprintf("%s:%s", token, m.options.mainMiner.ListenAddr) + cfg.Subsystems.SealerApiInfo = fmt.Sprintf("%s:%s", token, m.options.mainMiner.ListenAddr) + + fmt.Println("config for market node, setting SectorIndexApiInfo to: ", cfg.Subsystems.SectorIndexApiInfo) + fmt.Println("config for market node, setting SealerApiInfo to: ", cfg.Subsystems.SealerApiInfo) + } + }) + require.NoError(n.t, err) + c, err := lr.Config() require.NoError(n.t, err) @@ -423,28 +444,6 @@ func (n *Ensemble) Start() *Ensemble { if !ok { 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.EnableMining = m.options.subsystems.Has(SMining) - cfg.Subsystems.EnableSealing = m.options.subsystems.Has(SSealing) - cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage) - - if m.options.mainMiner != nil { - token, err := m.options.mainMiner.FullNode.AuthNew(ctx, api.AllPermissions) - require.NoError(n.t, err) - - cfg.Subsystems.SectorIndexApiInfo = fmt.Sprintf("%s:%s", token, m.options.mainMiner.ListenAddr) - cfg.Subsystems.SealerApiInfo = fmt.Sprintf("%s:%s", token, m.options.mainMiner.ListenAddr) - - fmt.Println("config for market node, setting SectorIndexApiInfo to: ", cfg.Subsystems.SectorIndexApiInfo) - fmt.Println("config for market node, setting SealerApiInfo to: ", cfg.Subsystems.SealerApiInfo) - } - - err = lr.SetConfig(func(raw interface{}) { - rcfg := raw.(*config.StorageMiner) - *rcfg = *cfg - }) - require.NoError(n.t, err) ks, err := lr.KeyStore() require.NoError(n.t, err)