// NewCustomFFSManager returns a new customized FFS manager.
NewCustomFFSManager returns a new customized FFS manager.
// NewCustomFFSManager returns a new customized FFS manager .
func NewCustomFFSManager(t require.TestingT, ds datastore.TxnDatastore, cb lotus.ClientBuilder, masterAddr address.Address, ms ffs.MinerSelector, ipfsClient *httpapi.HttpApi, minimumPieceSize uint64) (*manager.Manager, *coreipfs.CoreIpfs, func()) {
	dm, err := dealsModule.New(txndstr.Wrap(ds, "deals"), cb, util.AvgBlockTime, time.Minute*10)
	require.NoError(t, err)
	fchain := filchain.New(cb)
	l := joblogger.New(txndstr.Wrap(ds, "ffs/joblogger"))
	lsm, err := lotus.NewSyncMonitor(cb)
	require.NoError(t, err)
	cl := filcold.New(ms, dm, ipfsClient, fchain, l, lsm, minimumPieceSize, 1)
	hl, err := coreipfs.New(ds, ipfsClient, l)
	require.NoError(t, err)
	sched, err := scheduler.New(txndstr.Wrap(ds, "ffs/scheduler"), l, hl, cl, 10, time.Minute*10, nil, scheduler.GCConfig{AutoGCInterval: 0})
	require.NoError(t, err)
	wm, err := walletModule.New(cb, masterAddr, *big.NewInt(iWalletBal), false, "")
	require.NoError(t, err)
	manager, err := manager.New(ds, wm, dm, sched, false, true)
	require.NoError(t, err)
	err = manager.SetDefaultStorageConfig(ffs.StorageConfig{
		Hot: ffs.HotConfig{
			Enabled:       true,
			AllowUnfreeze: false,
			Ipfs: ffs.IpfsConfig{
				AddTimeout: 10,
			},
		},
		Cold: ffs.ColdConfig{
			Enabled: true,
			Filecoin: ffs.FilConfig{
				ExcludedMiners:  nil,
				DealMinDuration: util.MinDealDuration,
				RepFactor:       1,
			},
		},
	})
	require.NoError(t, err)
	return manager, hl, func() {
		if err := manager.Close(); err != nil {
			t.Errorf("closing api: %s", err)
			t.FailNow()
		}
		if err := sched.Close(); err != nil {
			t.Errorf("closing scheduler: %s", err)
			t.FailNow()
		}
		if err := l.Close(); err != nil {
			t.Errorf("closing joblogger: %s", err)
			t.FailNow()
		}
	}
}
func NewCustomFFSManager ( t require . TestingT , ds datastore . TxnDatastore , cb lotus . ClientBuilder , masterAddr address . Address , ms ffs . MinerSelector , ipfsClient * httpapi . HttpApi , minimumPieceSize uint64 ) ( * manager . Manager , * coreipfs . CoreIpfs , func ( ) ) { dm , err := dealsModule . New ( txndstr . Wrap ( ds , " " ) , cb , util . AvgBlockTime , time . Minute * 10 ) require . NoError ( t , err ) fchain := filchain . New ( cb ) l := joblogger . New ( txndstr . Wrap ( ds , " " ) ) lsm , err := lotus . NewSyncMonitor ( cb ) require . NoError ( t , err ) cl := filcold . New ( ms , dm , ipfsClient , fchain , l , lsm , minimumPieceSize , 1 ) hl , err := coreipfs . New ( ds , ipfsClient , l ) require . NoError ( t , err ) sched , err := scheduler . New ( txndstr . Wrap ( ds , " " ) , l , hl , cl , 10 , time . Minute * 10 , nil , scheduler . GCConfig { AutoGCInterval : 0 } ) require . NoError ( t , err ) wm , err := walletModule . New ( cb , masterAddr , * big . NewInt ( iWalletBal ) , false , " " ) require . NoError ( t , err ) manager , err := manager . New ( ds , wm , dm , sched , false , true ) require . NoError ( t , err ) err = manager . SetDefaultStorageConfig ( ffs . StorageConfig { Hot : ffs . HotConfig { Enabled : true , AllowUnfreeze : false , Ipfs : ffs . IpfsConfig { AddTimeout : 10 , } , } , Cold : ffs . ColdConfig { Enabled : true , Filecoin : ffs . FilConfig { ExcludedMiners : nil , DealMinDuration : util . MinDealDuration , RepFactor : 1 , } , } , } ) require . NoError ( t , err ) return manager , hl , func ( ) { if err := manager . Close ( ) ; err != nil { t . Errorf ( " " , err ) t . FailNow ( ) } if err := sched . Close ( ) ; err != nil { t . Errorf ( " " , err ) t . FailNow ( ) } if err := l . Close ( ) ; err != nil { t . Errorf ( " " , err ) t . FailNow ( ) } } }
NewCustomFFSManager returns a new customized FFS manager.
NewCustomFFSManager returns a new customized FFS manager .