service

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuctionFilters

type AuctionFilters struct {
	// DealDuration sets the min and max deal duration to bid on.
	DealDuration MinMaxFilter
	// DealSize sets the min and max deal size to bid on.
	DealSize MinMaxFilter
}

AuctionFilters specifies filters used when selecting auctions to bid on.

func (*AuctionFilters) Validate

func (f *AuctionFilters) Validate() error

Validate ensures AuctionFilters are valid.

type BidParams

type BidParams struct {
	// MinerAddr is your Filecoin miner address used to make deals.
	MinerAddr string
	// WalletAddrSig is a signature from your owner Lotus wallet address used to authenticate bids.
	WalletAddrSig []byte

	// AskPrice in attoFIL per GiB per epoch.
	AskPrice int64
	// VerifiedAskPrice in attoFIL per GiB per epoch.
	VerifiedAskPrice int64
	// FastRetrieval is whether or not you're offering fast retrieval for the deal data.
	FastRetrieval bool
	// DealStartWindow is the number of epochs after which won deals must start be on-chain.
	DealStartWindow uint64

	// DealDataDirectory is the directory to which deal data will be written.
	DealDataDirectory string
	// DealDataFetchAttempts is the number of times fetching deal data cid will be attempted.
	DealDataFetchAttempts uint32
	// DiscardOrphanDealsAfter is the time after which deals with no progress will be removed.
	DiscardOrphanDealsAfter time.Duration
}

BidParams defines how bids are made.

func (*BidParams) Validate

func (p *BidParams) Validate() error

Validate ensures BidParams are valid.

type Config

type Config struct {
	Peer           marketpeer.Config
	BidParams      BidParams
	AuctionFilters AuctionFilters
	BytesLimiter   limiter.Limiter
}

Config defines params for Service configuration.

type MinMaxFilter

type MinMaxFilter struct {
	Min uint64
	Max uint64
}

MinMaxFilter is used to specify a range for an auction filter.

func (*MinMaxFilter) Validate

func (f *MinMaxFilter) Validate() error

Validate ensures the filter is a valid min max window.

type Service

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

Service is a miner service that subscribes to brokered deals.

func New

New returns a new Service.

func (*Service) Close

func (s *Service) Close() error

Close the service.

func (*Service) GetBid

func (s *Service) GetBid(id auction.BidID) (*bidstore.Bid, error)

GetBid gets the bid with specific ID.

func (*Service) ListBids

func (s *Service) ListBids(query bidstore.Query) ([]*bidstore.Bid, error)

ListBids lists bids by applying a store.Query.

func (*Service) PeerInfo

func (s *Service) PeerInfo() (*marketpeer.PeerInfo, error)

PeerInfo returns the public information of the market peer.

func (*Service) Subscribe

func (s *Service) Subscribe(bootstrap bool) error

Subscribe to the deal auction feed. If bootstrap is true, the peer will dial the configured bootstrap addresses before joining the deal auction feed.

func (*Service) WriteDataURI

func (s *Service) WriteDataURI(payloadCid, uri string) (string, error)

WriteDataURI writes a data uri resource to the configured deal data directory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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