contentmgr

package
v0.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2022 License: Apache-2.0, MIT Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEAL_CHECK_UNKNOWN = iota
	DEAL_CHECK_PROGRESS
	DEAL_CHECK_DEALID_ON_CHAIN
	DEAL_CHECK_SECTOR_ON_CHAIN
	DEAL_NEARLY_EXPIRED
	DEAL_CHECK_SLASHED
)

Variables

View Source
var ErrNotOnChainYet = fmt.Errorf("message not found on chain")
View Source
var ErrWaitForRemoteCompute = fmt.Errorf("waiting for remote commP computation")
View Source
var ErrZoneCouldNotBeClaimed = fmt.Errorf("zone could not be claimed")

Functions

This section is empty.

Types

type ContentManager

type ContentManager struct {
	// contains filtered or unexported fields
}

func NewContentManager

func NewContentManager(
	db *gorm.DB,
	api api.Gateway,
	fc *filclient.FilClient,
	tbs *util.TrackingBlockstore,
	nd *node.Node,
	cfg *config.Estuary,
	minerManager miner.IMinerManager,
	log *zap.SugaredLogger,
	shuttleMgr shuttle.IManager,
	transferMgr transfer.IManager,
	queueMgr contentqueue.IQueueManager,
) (*ContentManager, error)

func (*ContentManager) AddDatabaseTracking

func (cm *ContentManager) AddDatabaseTracking(ctx context.Context, u *util.User, dserv ipld.NodeGetter, root cid.Cid, filename string, replication int) (*util.Content, error)

func (*ContentManager) AddDatabaseTrackingToContent

func (cm *ContentManager) AddDatabaseTrackingToContent(ctx context.Context, cont uint, dserv ipld.NodeGetter, root cid.Cid, cb func(int64)) (int64, error)

func (*ContentManager) AggregateStagingZone

func (cm *ContentManager) AggregateStagingZone(ctx context.Context, zone *model.StagingZone, zoneCont util.Content, loc string) error

AggregateStagingZone assumes zone is already in consolidatingZones

func (*ContentManager) CheckContentReadyForDealMaking added in v0.3.3

func (cm *ContentManager) CheckContentReadyForDealMaking(ctx context.Context, content util.Content) error

func (*ContentManager) ClearUnused

func (cm *ContentManager) ClearUnused(ctx context.Context, spaceRequest int64, loc string, users []uint, dryrun bool) (*collectionResult, error)

func (*ContentManager) CreateAggregate

func (cm *ContentManager) CreateAggregate(ctx context.Context, conts []util.Content) (ipld.Node, error)

func (*ContentManager) DealMakingDisabled

func (cm *ContentManager) DealMakingDisabled() bool

func (*ContentManager) DoPinning

func (*ContentManager) GarbageCollect

func (cm *ContentManager) GarbageCollect(ctx context.Context) error

func (*ContentManager) GetContent

func (cm *ContentManager) GetContent(id uint) (*util.Content, error)

func (*ContentManager) GetPieceCommitment

func (cm *ContentManager) GetPieceCommitment(ctx context.Context, data cid.Cid, bs blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)

func (*ContentManager) GetPinOperation

func (cm *ContentManager) GetPinOperation(cont util.Content, peers []*peer.AddrInfo, replaceID uint, makeDeal bool) *operation.PinningOperation

func (*ContentManager) GetProviderDealStatus

func (cm *ContentManager) GetProviderDealStatus(ctx context.Context, d *model.ContentDeal, maddr address.Address, dealUUID *uuid.UUID) (*storagemarket.ProviderDealState, bool, error)

first check deal protocol version 2, then check version 1

func (*ContentManager) GetRemovalCandidates

func (cm *ContentManager) GetRemovalCandidates(ctx context.Context, all bool, loc string, users []uint) ([]removalCandidateInfo, error)

func (*ContentManager) GetStagingZoneContents added in v0.3.2

func (cm *ContentManager) GetStagingZoneContents(ctx context.Context, user uint, zoneID uint, limit int, offset int) ([]util.Content, error)

func (*ContentManager) GetStagingZoneWithoutContents added in v0.3.2

func (cm *ContentManager) GetStagingZoneWithoutContents(ctx context.Context, userID uint, zoneID uint) (*model.StagingZone, error)

func (*ContentManager) GetStagingZonesForUser

func (cm *ContentManager) GetStagingZonesForUser(ctx context.Context, userID uint, limit int, offset int) ([]*model.StagingZone, error)

func (*ContentManager) MakeDealWithMiner

func (cm *ContentManager) MakeDealWithMiner(ctx context.Context, content util.Content, miner address.Address) (*model.ContentDeal, error)

func (*ContentManager) OffloadContents

func (cm *ContentManager) OffloadContents(ctx context.Context, conts []uint) (int, error)

func (*ContentManager) PinContent

func (cm *ContentManager) PinContent(ctx context.Context, user uint, obj cid.Cid, filename string, cols []*collections.CollectionRef, origins []*peer.AddrInfo, replaceID uint, meta map[string]interface{}, makeDeal bool) (*types.IpfsPinStatusResponse, *operation.PinningOperation, error)

func (*ContentManager) PinDelegatesForContent

func (cm *ContentManager) PinDelegatesForContent(cont util.Content) []string

func (*ContentManager) PinStatus

func (cm *ContentManager) PinStatus(cont util.Content, origins []*peer.AddrInfo) (*types.IpfsPinStatusResponse, error)

func (*ContentManager) RecordRetrievalFailure

func (cm *ContentManager) RecordRetrievalFailure(rfr *util.RetrievalFailureRecord) error

func (*ContentManager) RecordRetrievalSuccess

func (cm *ContentManager) RecordRetrievalSuccess(cc cid.Cid, m address.Address, rstats *filclient.RetrievalStats)

func (*ContentManager) RefreshContent

func (cm *ContentManager) RefreshContent(ctx context.Context, cont uint) error

func (*ContentManager) RefreshContentForCid

func (cm *ContentManager) RefreshContentForCid(ctx context.Context, c cid.Cid) (blocks.Block, error)

func (*ContentManager) RemoveContent

func (cm *ContentManager) RemoveContent(ctx context.Context, contID uint, now bool) error

func (*ContentManager) Run

func (cm *ContentManager) Run(ctx context.Context)

func (*ContentManager) SetDealMakingEnabled

func (cm *ContentManager) SetDealMakingEnabled(enable bool)

func (*ContentManager) ToCheck

func (cm *ContentManager) ToCheck(contID uint, contSize int64)

func (*ContentManager) TryRetrieve

func (cm *ContentManager) TryRetrieve(ctx context.Context, maddr address.Address, c cid.Cid, ask *retrievalmarket.QueryResponse) error

func (*ContentManager) UnpinContent

func (cm *ContentManager) UnpinContent(ctx context.Context, contid uint) error

func (*ContentManager) UpdatePinStatus

func (cm *ContentManager) UpdatePinStatus(contID uint, location string, status types.PinningStatus) error

even though there are 4 pin statuses, queued, pinning, pinned and failed the UpdatePinStatus only changes DB state for failed status when the content was added, status = pinning when the pin process is complete, status = pinned

type DealFailureError

type DealFailureError struct {
	Miner               address.Address
	DealUUID            string
	Phase               string
	Message             string
	Content             uint
	UserID              uint
	MinerAddress        string
	DealProtocolVersion protocol.ID
	MinerVersion        string
}

func (*DealFailureError) Error

func (dfe *DealFailureError) Error() string

func (*DealFailureError) Record

func (dfe *DealFailureError) Record() *model.DfeRecord

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL