Documentation ¶
Index ¶
- func DecodeNode(defnode *cbg.Deferred) (ipld.Node, error)
- func TransportConfigurer(thisPeer peer.ID, storeGetter StoreGetter) datatransfer.TransportConfigurer
- type Client
- type Manager
- type OfferManager
- type Provider
- type ProviderRequestValidator
- func (rv *ProviderRequestValidator) ValidatePull(isRestart bool, chid datatransfer.ChannelID, receiver peer.ID, ...) (datatransfer.VoucherResult, error)
- func (rv *ProviderRequestValidator) ValidatePush(isRestart bool, chid datatransfer.ChannelID, sender peer.ID, ...) (datatransfer.VoucherResult, error)
- type ProviderRevalidator
- func (pr *ProviderRevalidator) OnComplete(chid datatransfer.ChannelID) (bool, datatransfer.VoucherResult, error)
- func (pr *ProviderRevalidator) OnPullDataSent(chid datatransfer.ChannelID, additionalBytesSent uint64) (bool, datatransfer.VoucherResult, error)
- func (pr *ProviderRevalidator) OnPushDataReceived(chid datatransfer.ChannelID, additionalBytesReceived uint64) (bool, datatransfer.VoucherResult, error)
- func (pr *ProviderRevalidator) Revalidate(channelID datatransfer.ChannelID, voucher datatransfer.Voucher) (datatransfer.VoucherResult, error)
- func (pr *ProviderRevalidator) TrackChannel(d deal.ProviderState)
- func (pr *ProviderRevalidator) UntrackChannel(d deal.ProviderState)
- type Retrieval
- type RevalidatorEnvironment
- type StoreConfigurableTransport
- type StoreGetter
- type StoreIDGetter
- type Unsubscribe
- type ValidationEnvironment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeNode ¶
DecodeNode validates and computes a decoded ipld.Node selector from the provided cbor-encoded selector TODO: ipld sub module
func TransportConfigurer ¶
func TransportConfigurer(thisPeer peer.ID, storeGetter StoreGetter) datatransfer.TransportConfigurer
TransportConfigurer configurers the graphsync transport to use a custom blockstore per deal
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps all the client operations
func (*Client) Retrieve ¶
func (c *Client) Retrieve( ctx context.Context, root cid.Cid, params deal.Params, totalFunds abi.TokenAmount, sender peer.ID, clientAddr address.Address, providerAddr address.Address, storeID *multistore.StoreID, ) (deal.ID, error)
Retrieve content
func (*Client) SubscribeToEvents ¶
func (c *Client) SubscribeToEvents(subscriber client.Subscriber) Unsubscribe
SubscribeToEvents to listen to transfer state changes on the client side
func (*Client) TryRestartInsufficientFunds ¶
TryRestartInsufficientFunds attempts to restart any deals stuck in the insufficient funds state after funds are added to a given payment channel
type OfferManager ¶
type OfferManager interface { SetOfferForCid(cid.Cid, deal.Offer) error GetOfferForCid(cid.Cid) deal.Offer }
OfferManager organizes and stores offers for authorizing retrieval deals
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider wraps all the provider operations
func (*Provider) SubscribeToEvents ¶
func (p *Provider) SubscribeToEvents(subscriber provider.Subscriber) Unsubscribe
SubscribeToEvents to listen to transfer state changes on the provider side
type ProviderRequestValidator ¶
type ProviderRequestValidator struct {
// contains filtered or unexported fields
}
ProviderRequestValidator validates incoming requests for the Retrieval Provider
func NewProviderRequestValidator ¶
func NewProviderRequestValidator(env ValidationEnvironment) *ProviderRequestValidator
NewProviderRequestValidator returns a new instance of the ProviderRequestValidator
func (*ProviderRequestValidator) ValidatePull ¶
func (rv *ProviderRequestValidator) ValidatePull(isRestart bool, chid datatransfer.ChannelID, receiver peer.ID, voucher datatransfer.Voucher, baseCid cid.Cid, selector ipld.Node) (datatransfer.VoucherResult, error)
ValidatePull validates a pull request received from the peer that will receive data
func (*ProviderRequestValidator) ValidatePush ¶
func (rv *ProviderRequestValidator) ValidatePush(isRestart bool, chid datatransfer.ChannelID, sender peer.ID, voucher datatransfer.Voucher, baseCid cid.Cid, selector ipld.Node) (datatransfer.VoucherResult, error)
ValidatePush validates a push request received from the peer that will send data
type ProviderRevalidator ¶
type ProviderRevalidator struct {
// contains filtered or unexported fields
}
ProviderRevalidator defines data transfer revalidation logic in the context of a provider for a retrieval deal
func NewProviderRevalidator ¶
func NewProviderRevalidator(env RevalidatorEnvironment) *ProviderRevalidator
NewProviderRevalidator returns a new instance of a ProviderRevalidator
func (*ProviderRevalidator) OnComplete ¶
func (pr *ProviderRevalidator) OnComplete(chid datatransfer.ChannelID) (bool, datatransfer.VoucherResult, error)
OnComplete is called to make a final request for revalidation -- often for the purpose of settlement. if VoucherResult is non nil, the request will enter a settlement phase awaiting a final update
func (*ProviderRevalidator) OnPullDataSent ¶
func (pr *ProviderRevalidator) OnPullDataSent(chid datatransfer.ChannelID, additionalBytesSent uint64) (bool, datatransfer.VoucherResult, error)
OnPullDataSent is called on the responder side when more bytes are sent for a given pull request. It should return a VoucherResult + ErrPause to request revalidation or nil to continue uninterrupted, other errors will terminate the request
func (*ProviderRevalidator) OnPushDataReceived ¶
func (pr *ProviderRevalidator) OnPushDataReceived(chid datatransfer.ChannelID, additionalBytesReceived uint64) (bool, datatransfer.VoucherResult, error)
OnPushDataReceived is called on the responder side when more bytes are received for a given push request. It should return a VoucherResult + ErrPause to request revalidation or nil to continue uninterrupted, other errors will terminate the request
func (*ProviderRevalidator) Revalidate ¶
func (pr *ProviderRevalidator) Revalidate(channelID datatransfer.ChannelID, voucher datatransfer.Voucher) (datatransfer.VoucherResult, error)
Revalidate revalidates a request with a new voucher
func (*ProviderRevalidator) TrackChannel ¶
func (pr *ProviderRevalidator) TrackChannel(d deal.ProviderState)
TrackChannel indicates a retrieval deal tracked by this provider. It associates a given channel ID with a retrieval deal, so that checks run for data sent on the channel
func (*ProviderRevalidator) UntrackChannel ¶
func (pr *ProviderRevalidator) UntrackChannel(d deal.ProviderState)
UntrackChannel indicates a retrieval deal is finish and no longer is tracked by this provider
type Retrieval ¶
type Retrieval struct {
// contains filtered or unexported fields
}
Retrieval manager implementation
type RevalidatorEnvironment ¶
type RevalidatorEnvironment interface { Payments() payments.Manager SendEvent(dealID deal.ProviderDealIdentifier, evt provider.Event, args ...interface{}) error Get(dealID deal.ProviderDealIdentifier) (deal.ProviderState, error) }
RevalidatorEnvironment are the dependencies needed to build the logic of revalidation -- essentially, access to the node at statemachines
type StoreConfigurableTransport ¶
type StoreConfigurableTransport interface {
UseStore(datatransfer.ChannelID, ipld.LinkSystem) error
}
StoreConfigurableTransport defines the methods needed to configure a data transfer transport use a unique store for a given request
type StoreGetter ¶
StoreGetter retrieves the store for a given proposal cid
type StoreIDGetter ¶
type StoreIDGetter interface {
GetStoreID(cid.Cid) (multistore.StoreID, error)
}
StoreIDGetter is an interface required for finding the store associated with the content to provide
type Unsubscribe ¶
type Unsubscribe func()
Unsubscribe is a function that unsubscribes a subscriber for either the client or the provider
type ValidationEnvironment ¶
type ValidationEnvironment interface { // CheckDealParams verifies the given deal params are acceptable CheckDealParams(deal.ProviderState) error // StateMachines returns the FSM Group to begin tracking with BeginTracking(pds deal.ProviderState) error // NextStoreID allocates a store for this deal NextStoreID() (multistore.StoreID, error) // GetStoreID gets an existing store for this deal GetStoreID(cid.Cid) (multistore.StoreID, error) }
ValidationEnvironment contains the dependencies needed to validate deals