// NewAPI returns a new set of components for FFS.
NewAPI returns a new set of components for FFS.
// NewAPI returns a new set of components for FFS .
func NewAPI(t tests.TestingTWithCleanup, numMiners int) (*httpapi.HttpApi, *apistruct.FullNodeStruct, *api.API, func()) {
	ds := tests.NewTxMapDatastore()
	ipfs, ipfsMAddr := it.CreateIPFS(t)
	addr, clientBuilder, ms := NewDevnet(t, numMiners, ipfsMAddr)
	manager, closeManager := NewFFSManager(t, ds, clientBuilder, addr, ms, ipfs)
	auth, err := manager.Create(context.Background())
	require.NoError(t, err)
	time.Sleep(time.Second * 3) 
	fapi, err := manager.GetByAuthToken(auth.Token)
	require.NoError(t, err)
	client, cls, err := clientBuilder(context.Background())
	require.NoError(t, err)
	return ipfs, client, fapi, func() {
		err := fapi.Close()
		require.NoError(t, err)
		closeManager()
		cls()
	}
}
func NewAPI ( t tests . TestingTWithCleanup , numMiners int ) ( * httpapi . HttpApi , * apistruct . FullNodeStruct , * api . API , func ( ) ) { ds := tests . NewTxMapDatastore ( ) ipfs , ipfsMAddr := it . CreateIPFS ( t ) addr , clientBuilder , ms := NewDevnet ( t , numMiners , ipfsMAddr ) manager , closeManager := NewFFSManager ( t , ds , clientBuilder , addr , ms , ipfs ) auth , err := manager . Create ( context . Background ( ) ) require . NoError ( t , err ) time . Sleep ( time . Second * 3 ) fapi , err := manager . GetByAuthToken ( auth . Token ) require . NoError ( t , err ) client , cls , err := clientBuilder ( context . Background ( ) ) require . NoError ( t , err ) return ipfs , client , fapi , func ( ) { err := fapi . Close ( ) require . NoError ( t , err ) closeManager ( ) cls ( ) } }
NewAPI returns a new set of components for FFS.
NewAPI returns a new set of components for FFS .
// Wait for funding txn to finish.