service

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Peer               rpcpeer.Config
	Auction            auctioneer.AuctionConfig
	PostgresURI        string
	RecordBidbotEvents bool
}

Config defines params for Service configuration.

type Service

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

Service is a gRPC service wrapper around an Auctioneer.

func New

func New(conf Config, mb mbroker.MsgBroker, fc filclient.FilClient) (*Service, error)

New returns a new Service.

func (*Service) Close

func (s *Service) Close() error

Close the service.

func (*Service) GetAuction

func (s *Service) GetAuction(ctx context.Context, id auction.ID) (*core.Auction, error)

GetAuction gets the state of an auction by id. Mostly for test purpose.

func (*Service) OnBoostDealProposalAccepted

func (s *Service) OnBoostDealProposalAccepted(
	ctx context.Context,
	auctionID auction.ID,
	bidID auction.BidID,
	dealUID string,
) error

OnBoostDealProposalAccepted receives an accepted boost deal proposal from a storage-provider.

func (*Service) OnDealProposalAccepted

func (s *Service) OnDealProposalAccepted(
	ctx context.Context,
	auctionID auction.ID,
	bidID auction.BidID,
	proposalCid cid.Cid,
) error

OnDealProposalAccepted receives an accepted deal proposal from a storage-provider.

func (*Service) OnFinalizedDeal

func (s *Service) OnFinalizedDeal(ctx context.Context, _ mbroker.OperationID, fad broker.FinalizedDeal) error

OnFinalizedDeal receives a finalized deal from a storage-provider.

func (*Service) OnReadyToAuction

func (s *Service) OnReadyToAuction(
	ctx context.Context,
	id auction.ID,
	sdID broker.BatchID,
	payloadCid cid.Cid,
	dealSize uint64,
	dealDuration uint64,
	dealReplication uint32,
	dealVerified bool,
	excludedStorageProviders []string,
	filEpochDeadline uint64,
	sources auction.Sources,
	clientAddress string,
	providers []string,
) error

OnReadyToAuction handles messagse from ready-to-auction topic.

func (*Service) PeerInfo

func (s *Service) PeerInfo() (*rpcpeer.Info, error)

PeerInfo returns the peer's public information.

func (*Service) Start

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

Start the deal auction feed. If bootstrap is true, the peer will dial the configured bootstrap addresses before creating the deal auction feed.

Jump to

Keyboard shortcuts

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