Documentation
¶
Index ¶
- Constants
- Variables
- type ContentManager
- func (cm *ContentManager) AddDatabaseTracking(ctx context.Context, u *util.User, dserv ipld.NodeGetter, root cid.Cid, ...) (*util.Content, error)
- func (cm *ContentManager) AddDatabaseTrackingToContent(ctx context.Context, cont uint, dserv ipld.NodeGetter, root cid.Cid, ...) error
- func (cm *ContentManager) AggregateStagingZone(ctx context.Context, z *ContentStagingZone, grpLocs map[string]string) error
- func (cm *ContentManager) ClearUnused(ctx context.Context, spaceRequest int64, loc string, users []uint, dryrun bool) (*collectionResult, error)
- func (cm *ContentManager) CreateAggregate(ctx context.Context, conts []util.Content) (ipld.Node, error)
- func (cm *ContentManager) DealMakingDisabled() bool
- func (cm *ContentManager) GarbageCollect(ctx context.Context) error
- func (cm *ContentManager) GetContent(id uint) (*util.Content, error)
- func (cm *ContentManager) GetPieceCommitment(ctx context.Context, data cid.Cid, bs blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)
- func (cm *ContentManager) GetProviderDealStatus(ctx context.Context, d *model.ContentDeal, maddr address.Address, ...) (*storagemarket.ProviderDealState, bool, error)
- func (cm *ContentManager) GetRemovalCandidates(ctx context.Context, all bool, loc string, users []uint) ([]removalCandidateInfo, error)
- func (cm *ContentManager) GetStagingZoneSnapshot(ctx context.Context) map[uint][]*ContentStagingZone
- func (cm *ContentManager) GetStagingZonesForUser(ctx context.Context, user uint) []*ContentStagingZone
- func (cm *ContentManager) GetTransferStatus(ctx context.Context, d *model.ContentDeal, contCID cid.Cid, contLoc string) (*filclient.ChannelState, error)
- func (cm *ContentManager) HandleRpcTransferStatus(ctx context.Context, handle string, param *drpc.TransferStatus) error
- func (cm *ContentManager) HandleSanityCheck(cc cid.Cid, errMsg string)
- func (cm *ContentManager) HandleShuttleMessages(ctx context.Context, numHandlers int)
- func (cm *ContentManager) MakeDealWithMiner(ctx context.Context, content util.Content, miner address.Address) (uint, error)
- func (cm *ContentManager) OffloadContents(ctx context.Context, conts []uint) (int, error)
- func (cm *ContentManager) PinContent(ctx context.Context, user uint, obj cid.Cid, filename string, ...) (*types.IpfsPinStatusResponse, error)
- func (cm *ContentManager) PinDelegatesForContent(cont util.Content) []string
- func (cm *ContentManager) PinStatus(cont util.Content, origins []*peer.AddrInfo) (*types.IpfsPinStatusResponse, error)
- func (cm *ContentManager) RecordRetrievalFailure(rfr *util.RetrievalFailureRecord) error
- func (cm *ContentManager) RecordRetrievalSuccess(cc cid.Cid, m address.Address, rstats *filclient.RetrievalStats)
- func (cm *ContentManager) RefreshContent(ctx context.Context, cont uint) error
- func (cm *ContentManager) RefreshContentForCid(ctx context.Context, c cid.Cid) (blocks.Block, error)
- func (cm *ContentManager) RegisterShuttleConnection(handle string, hello *drpc.Hello) (chan *drpc.Command, func(), error)
- func (cm *ContentManager) RemoveContent(ctx context.Context, contID uint, now bool) error
- func (cm *ContentManager) RestartTransfer(ctx context.Context, loc string, chanid datatransfer.ChannelID, ...) error
- func (cm *ContentManager) Run(ctx context.Context)
- func (cm *ContentManager) RunPinningRetryWorker(ctx context.Context)
- func (cm *ContentManager) SendAggregateCmd(ctx context.Context, loc string, cont util.Content, ...) error
- func (cm *ContentManager) SendConsolidateContentCmd(ctx context.Context, loc string, contents []util.Content) error
- func (cm *ContentManager) SendShuttleCommand(ctx context.Context, handle string, cmd *drpc.Command) error
- func (cm *ContentManager) SetDataTransferStartedOrFinished(ctx context.Context, dealDBID uint, chanIDOrTransferID string, ...) error
- func (cm *ContentManager) SetDealMakingEnabled(enable bool)
- func (cm *ContentManager) ShuttleAddrInfo(handle string) *peer.AddrInfo
- func (cm *ContentManager) ShuttleCanAddContent(handle string) bool
- func (cm *ContentManager) ShuttleHostName(handle string) string
- func (cm *ContentManager) ShuttleIsOnline(handle string) bool
- func (cm *ContentManager) ShuttleStorageStats(handle string) *util.ShuttleStorageStats
- func (cm *ContentManager) StartDataTransfer(ctx context.Context, cd *model.ContentDeal) error
- func (cm *ContentManager) ToCheck(contID uint)
- func (cm *ContentManager) TryRetrieve(ctx context.Context, maddr address.Address, c cid.Cid, ...) error
- func (cm *ContentManager) UnpinContent(ctx context.Context, contid uint) error
- func (cm *ContentManager) UpdatePinStatus(location string, contID uint, status types.PinningStatus) error
- type ContentStagingZone
- type DealFailureError
- type ShuttleConnection
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 ErrNilParams = fmt.Errorf("shuttle message had nil params")
View Source
var ErrNoShuttleConnection = fmt.Errorf("no connection to requested shuttle")
View Source
var ErrNotOnChainYet = fmt.Errorf("message not found on chain")
View Source
var ErrWaitForRemoteCompute = fmt.Errorf("waiting for remote commP computation")
Functions ¶
This section is empty.
Types ¶
type ContentManager ¶
type ContentManager struct {
DB *gorm.DB
Api api.Gateway
FilClient *filclient.FilClient
Node *node.Node
Blockstore node.EstuaryBlockstore
Tracker *util.TrackingBlockstore
NotifyBlockstore *node.NotifyBlockstore
// deal bucketing stuff
BucketLk sync.Mutex
Buckets map[uint][]*ContentStagingZone
// some behavior flags
FailDealOnTransferFailure bool
PinMgr *pinner.PinManager
ShuttlesLk sync.Mutex
Shuttles map[string]*ShuttleConnection
DisableFilecoinStorage bool
IncomingRPCMessages chan *drpc.Message
// contains filtered or unexported fields
}
func NewContentManager ¶
func NewContentManager(db *gorm.DB, api api.Gateway, fc *filclient.FilClient, tbs *util.TrackingBlockstore, pinmgr *pinner.PinManager, nd *node.Node, cfg *config.Estuary, minerManager miner.IMinerManager, log *zap.SugaredLogger) (*ContentManager, error)
func (*ContentManager) AddDatabaseTracking ¶
func (*ContentManager) AddDatabaseTrackingToContent ¶
func (cm *ContentManager) AddDatabaseTrackingToContent(ctx context.Context, cont uint, dserv ipld.NodeGetter, root cid.Cid, cb func(int64)) error
func (*ContentManager) AggregateStagingZone ¶
func (cm *ContentManager) AggregateStagingZone(ctx context.Context, z *ContentStagingZone, grpLocs map[string]string) error
func (*ContentManager) ClearUnused ¶
func (*ContentManager) CreateAggregate ¶
func (*ContentManager) DealMakingDisabled ¶
func (cm *ContentManager) DealMakingDisabled() bool
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) 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 (*ContentManager) GetStagingZoneSnapshot ¶
func (cm *ContentManager) GetStagingZoneSnapshot(ctx context.Context) map[uint][]*ContentStagingZone
func (*ContentManager) GetStagingZonesForUser ¶
func (cm *ContentManager) GetStagingZonesForUser(ctx context.Context, user uint) []*ContentStagingZone
func (*ContentManager) GetTransferStatus ¶
func (cm *ContentManager) GetTransferStatus(ctx context.Context, d *model.ContentDeal, contCID cid.Cid, contLoc string) (*filclient.ChannelState, error)
func (*ContentManager) HandleRpcTransferStatus ¶
func (cm *ContentManager) HandleRpcTransferStatus(ctx context.Context, handle string, param *drpc.TransferStatus) error
func (*ContentManager) HandleSanityCheck ¶
func (cm *ContentManager) HandleSanityCheck(cc cid.Cid, errMsg string)
func (*ContentManager) HandleShuttleMessages ¶
func (cm *ContentManager) HandleShuttleMessages(ctx context.Context, numHandlers int)
func (*ContentManager) MakeDealWithMiner ¶
func (*ContentManager) OffloadContents ¶
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, 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 (*ContentManager) RegisterShuttleConnection ¶
func (*ContentManager) RemoveContent ¶
func (*ContentManager) RestartTransfer ¶
func (cm *ContentManager) RestartTransfer(ctx context.Context, loc string, chanid datatransfer.ChannelID, d model.ContentDeal) error
RestartTransfer tries to resume incomplete data transfers between client and storage providers. It supports only legacy deals (PushTransfer)
func (*ContentManager) Run ¶
func (cm *ContentManager) Run(ctx context.Context)
func (*ContentManager) RunPinningRetryWorker ¶
func (cm *ContentManager) RunPinningRetryWorker(ctx context.Context)
RunPinningRetryWorker re-attempt pinning contents that have not yet been pinned after a period of time
func (*ContentManager) SendAggregateCmd ¶
func (cm *ContentManager) SendAggregateCmd(ctx context.Context, loc string, cont util.Content, aggr []drpc.AggregateContent) error
func (*ContentManager) SendConsolidateContentCmd ¶
func (*ContentManager) SendShuttleCommand ¶
func (*ContentManager) SetDataTransferStartedOrFinished ¶
func (cm *ContentManager) SetDataTransferStartedOrFinished(ctx context.Context, dealDBID uint, chanIDOrTransferID string, st *filclient.ChannelState, isStarted bool) error
func (*ContentManager) SetDealMakingEnabled ¶
func (cm *ContentManager) SetDealMakingEnabled(enable bool)
func (*ContentManager) ShuttleAddrInfo ¶
func (cm *ContentManager) ShuttleAddrInfo(handle string) *peer.AddrInfo
func (*ContentManager) ShuttleCanAddContent ¶
func (cm *ContentManager) ShuttleCanAddContent(handle string) bool
func (*ContentManager) ShuttleHostName ¶
func (cm *ContentManager) ShuttleHostName(handle string) string
func (*ContentManager) ShuttleIsOnline ¶
func (cm *ContentManager) ShuttleIsOnline(handle string) bool
func (*ContentManager) ShuttleStorageStats ¶
func (cm *ContentManager) ShuttleStorageStats(handle string) *util.ShuttleStorageStats
func (*ContentManager) StartDataTransfer ¶
func (cm *ContentManager) StartDataTransfer(ctx context.Context, cd *model.ContentDeal) error
func (*ContentManager) ToCheck ¶
func (cm *ContentManager) ToCheck(contID uint)
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(location string, contID uint, 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 ContentStagingZone ¶
type ContentStagingZone struct {
ZoneOpened time.Time `json:"zoneOpened"`
Contents []util.Content `json:"contents"`
MinSize int64 `json:"minSize"`
MaxSize int64 `json:"maxSize"`
CurSize int64 `json:"curSize"`
User uint `json:"user"`
ContID uint `json:"contentID"`
Location string `json:"location"`
IsConsolidating bool `json:"isConsolidating"`
Readiness stagingZoneReadiness `json:"readiness"`
// contains filtered or unexported fields
}
func (*ContentStagingZone) DeepCopy ¶
func (cb *ContentStagingZone) DeepCopy() *ContentStagingZone
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
type ShuttleConnection ¶
Click to show internal directories.
Click to hide internal directories.