Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ProviderBlockList map[peer.ID]bool ProviderAllowList map[peer.ID]bool DefaultMinerConfig MinerConfig MinerConfigs map[peer.ID]MinerConfig PaidRetrievals bool }
All config values should be safe to leave uninitialized
type MinerConfig ¶
type Session ¶
type Session struct { State // contains filtered or unexported fields }
func NewSession ¶
func (*Session) FilterIndexerCandidate ¶
func (s *Session) FilterIndexerCandidate(candidate types.RetrievalCandidate) (bool, types.RetrievalCandidate)
isAcceptableStorageProvider checks whether the storage provider in question is acceptable as a retrieval candidate. It checks the blacklists and whitelists, the miner monitor for failures and whether we are already at concurrency limit for this SP.
func (*Session) GetStorageProviderTimeout ¶
func (*Session) IsAcceptableQueryResponse ¶
func (s *Session) IsAcceptableQueryResponse(peer peer.ID, req types.RetrievalRequest, queryResponse *retrievaltypes.QueryResponse) bool
IsAcceptableQueryResponse determines whether a queryResponse is acceptable according to the current configuration. For now this is just checking whether PaidRetrievals is set and not accepting paid retrievals if so.
type State ¶
type State interface { RecordFailure(storageProviderId peer.ID, retrievalId types.RetrievalID) error RemoveStorageProviderFromRetrieval(storageProviderId peer.ID, retrievalId types.RetrievalID) error IsSuspended(storageProviderId peer.ID) bool GetConcurrency(storageProviderId peer.ID) uint AddToRetrieval(retrievalId types.RetrievalID, storageProviderIds []peer.ID) error EndRetrieval(retrievalId types.RetrievalID) error RegisterRetrieval(retrievalId types.RetrievalID, cid cid.Cid, selector datamodel.Node) bool }
Click to show internal directories.
Click to hide internal directories.