dealer

package
v0.0.0-...-269d6e4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dealer

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

Dealer creates, monitors and reports deals in the Filecoin network.

func New

func New(
	postgresURI string,
	mb mbroker.MsgBroker,
	fc FilClient,
	opts ...Option) (*Dealer, error)

New returns a new Dealer.

func (*Dealer) Close

func (d *Dealer) Close() error

Close closes the dealer.

func (*Dealer) ReadyToCreateDeals

func (d *Dealer) ReadyToCreateDeals(ctx context.Context, ad dealeri.AuctionDeals) error

ReadyToCreateDeals signal the dealer that new deals are ready to be executed.

type FilClient

type FilClient interface {
	ExecuteAuctionDeal(
		ctx context.Context,
		ad store.AuctionData,
		aud store.AuctionDeal,
		rw *store.RemoteWallet) (string, bool, error)
	GetChainHeight(ctx context.Context) (uint64, error)
	ResolveDealIDFromMessage(
		ctx context.Context,
		publishDealMessage cid.Cid,
		spID string,
		pieceCid cid.Cid,
		startEpoch uint64) (int64, error)
	CheckChainDeal(ctx context.Context, dealID int64) (bool, uint64, bool, error)
	CheckDealStatusWithStorageProvider(
		ctx context.Context,
		storageProviderID string,
		dealIdentifier string,
		rw *store.RemoteWallet) (*cid.Cid, storagemarket.StorageDealStatus, error)
}

FilClient provides functionalities to create and monitor Filecoin deals.

type Option

type Option func(*config) error

Option applies a configuration change.

func WithDealMakingFreq

func WithDealMakingFreq(f time.Duration) Option

WithDealMakingFreq configures the frequency of deal making polling.

func WithDealMakingMaxRetries

func WithDealMakingMaxRetries(max int) Option

WithDealMakingMaxRetries specifies the maximum amount of retries on recoverable errros during deal making execution.

func WithDealMakingRateLim

func WithDealMakingRateLim(l int) Option

WithDealMakingRateLim configures the max number of parallel execution items.

func WithDealMakingRetryDelay

func WithDealMakingRetryDelay(delay time.Duration) Option

WithDealMakingRetryDelay specifies how much time retries are delayed for reprocessing.

func WithDealReportingFreq

func WithDealReportingFreq(f time.Duration) Option

WithDealReportingFreq configures the frequency of deals reporting polling.

func WithDealReportingRetryDelay

func WithDealReportingRetryDelay(delay time.Duration) Option

WithDealReportingRetryDelay specifies how much time to delay retrying reporting results to the broker.

func WithDealWatchingCheckChainRetryDelay

func WithDealWatchingCheckChainRetryDelay(delay time.Duration) Option

WithDealWatchingCheckChainRetryDelay specifies how much time to delay retrying checking on-chain for a deal confirmation.

func WithDealWatchingFreq

func WithDealWatchingFreq(f time.Duration) Option

WithDealWatchingFreq configures the frequency of deal monitoring polling.

func WithDealWatchingRateLim

func WithDealWatchingRateLim(l int) Option

WithDealWatchingRateLim configures the max number of parallel execution items.

func WithDealWatchingResolveDealIDRetryDelay

func WithDealWatchingResolveDealIDRetryDelay(delay time.Duration) Option

WithDealWatchingResolveDealIDRetryDelay specifies how much time to delay retrying resolving a new deal-id.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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