boosttypes

package
v0.0.0-...-9f67d33 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0, MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const DataTransferProtocol = "/fil/storage/transfer/1.0.0"
View Source
const Libp2pScheme = "libp2p"

Variables

View Source
var BindnodeRegistry = bindnoderegistry.NewRegistry()

Functions

This section is empty.

Types

type AskGetter

type AskGetter interface {
	GetAsk() *storagemarket.SignedStorageAsk
}

type ChainDealManager

type ChainDealManager interface {
	WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal market.DealProposal) (*storagemarket.PublishDealsWaitResult, error)
}

type Checkpoint

type Checkpoint int
const (
	Accepted Checkpoint = iota
	Transferred
	Published
	PublishConfirmed
	AddedPiece
	IndexedAndAnnounced
	Complete
)

func (Checkpoint) String

func (c Checkpoint) String() string

type CommpCalculator

type CommpCalculator interface {
	ComputeDataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error)
}

type DealFilterParams

type DealFilterParams struct {
	DealParams           *DealParams
	SealingPipelineState *Status
}

type DealParams

type DealParams struct {
	DealUUID           uuid.UUID
	IsOffline          bool
	ClientDealProposal market.ClientDealProposal
	DealDataRoot       cid.Cid
	Transfer           Transfer // Transfer params will be the zero value if this is an offline deal
}

func (*DealParams) MarshalCBOR

func (t *DealParams) MarshalCBOR(w io.Writer) error

func (*DealParams) UnmarshalCBOR

func (t *DealParams) UnmarshalCBOR(r io.Reader) (err error)

type DealPublisher

type DealPublisher interface {
	Publish(ctx context.Context, deal market.ClientDealProposal) (cid.Cid, error)
}

type DealResponse

type DealResponse struct {
	Accepted bool
	// Message is the reason the deal proposal was rejected. It is empty if
	// the deal was accepted.
	Message string
}

func (*DealResponse) MarshalCBOR

func (t *DealResponse) MarshalCBOR(w io.Writer) error

func (*DealResponse) UnmarshalCBOR

func (t *DealResponse) UnmarshalCBOR(r io.Reader) (err error)

type DealRetryType

type DealRetryType string
const (
	// DealRetryAuto means that when boost restarts, it will automatically
	// retry the deal
	DealRetryAuto DealRetryType = "auto"
	// DealRetryManual means that boost will not automatically retry the
	// deal, it must be manually retried by the user
	DealRetryManual DealRetryType = "manual"
	// DealRetryFatal means that the deal will fail immediately and permanently
	DealRetryFatal DealRetryType = "fatal"
)

type DealStatus

type DealStatus struct {
	// Error is non-empty if the deal is in the error state
	Error string
	// Status is a string corresponding to a deal checkpoint
	Status string
	// SealingStatus is the sealing status reported by lotus miner
	SealingStatus string
	// Proposal is the deal proposal
	Proposal market.DealProposal
	// SignedProposalCid is the cid of the client deal proposal + signature
	SignedProposalCid cid.Cid
	// PublishCid is the cid of the Publish message sent on chain, if the deal
	// has reached the publish stage
	PublishCid *cid.Cid
	// ChainDealID is the id of the deal in chain state
	ChainDealID abi.DealID
}

func (*DealStatus) MarshalCBOR

func (t *DealStatus) MarshalCBOR(w io.Writer) error

func (*DealStatus) UnmarshalCBOR

func (t *DealStatus) UnmarshalCBOR(r io.Reader) (err error)

type DealStatusRequest

type DealStatusRequest struct {
	DealUUID  uuid.UUID
	Signature crypto.Signature
}

DealStatusRequest is sent to get the current state of a deal from a storage provider

func (*DealStatusRequest) MarshalCBOR

func (t *DealStatusRequest) MarshalCBOR(w io.Writer) error

func (*DealStatusRequest) UnmarshalCBOR

func (t *DealStatusRequest) UnmarshalCBOR(r io.Reader) (err error)

type DealStatusResponse

type DealStatusResponse struct {
	DealUUID uuid.UUID
	// Error is non-empty if there is an error getting the deal status
	// (eg invalid request signature)
	Error          string
	DealStatus     *DealStatus
	IsOffline      bool
	TransferSize   uint64
	NBytesReceived uint64
}

DealStatusResponse is the current state of a deal

func (*DealStatusResponse) MarshalCBOR

func (t *DealStatusResponse) MarshalCBOR(w io.Writer) error

func (*DealStatusResponse) UnmarshalCBOR

func (t *DealStatusResponse) UnmarshalCBOR(r io.Reader) (err error)

type HttpRequest

type HttpRequest struct {
	// URL can be
	// - an http URL:
	//   "https://example.com/path"
	// - a libp2p URL:
	//   "libp2p:///ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
	//   Must include a Peer ID
	URL string
	// Headers are the HTTP headers that are sent as part of the request,
	// eg "Authorization"
	Headers map[string]string
}

HttpRequest has parameters for an HTTP transfer

type IndexProvider

type IndexProvider interface {
	Enabled() bool
	AnnounceBoostDeal(ctx context.Context, pds *ProviderDealState) (cid.Cid, error)
	Start(ctx context.Context)
}

type PieceAdder

type PieceAdder interface {
	AddPiece(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader, d api.PieceDealInfo) (abi.SectorNumber, abi.PaddedPieceSize, error)
}

type Protocol

type Protocol struct {
	// The name of the transport protocol eg "libp2p" or "http"
	Name string
	// The address of the endpoint in multiaddr format
	Addresses []multiaddr.Multiaddr
}

type ProviderDealState

type ProviderDealState struct {
	// DealUuid is an unique uuid generated by client for the deal.
	DealUuid uuid.UUID
	// CreatedAt is the time at which the deal was stored
	CreatedAt time.Time
	// ClientDealProposal is the deal proposal sent by the client.
	ClientDealProposal market.ClientDealProposal
	// IsOffline is true for offline deals i.e. deals where the actual data to be stored by the SP is sent out of band
	// and not via an online data transfer.
	IsOffline bool

	// ClientPeerID is the Clients libp2p Peer ID.
	ClientPeerID peer.ID

	// DealDataRoot is the root of the IPLD DAG that the client wants to store.
	DealDataRoot cid.Cid

	// InboundCARPath is the file-path where the storage provider will persist the CAR file sent by the client.
	InboundFilePath string

	// Transfer has the parameters for the data transfer
	Transfer Transfer

	// Chain Vars
	ChainDealID abi.DealID
	PublishCID  *cid.Cid

	// sector packing info
	SectorID abi.SectorNumber
	Offset   abi.PaddedPieceSize
	Length   abi.PaddedPieceSize

	// deal checkpoint in DB.
	Checkpoint Checkpoint
	// CheckpointAt is the time at which the deal entered in the last state
	CheckpointAt time.Time

	// set if there's an error
	Err string
	// if there was an error, indicates whether and how to retry (auto / manual)
	Retry DealRetryType

	// NBytesReceived is the number of bytes Received for this deal
	NBytesReceived int64
}

ProviderDealState is the local state tracked for a deal by the StorageProvider.

func (*ProviderDealState) SignedProposalCid

func (d *ProviderDealState) SignedProposalCid() (cid.Cid, error)

func (*ProviderDealState) String

func (d *ProviderDealState) String() string

type QueryResponse

type QueryResponse struct {
	Protocols []Protocol
}

type SignatureVerifier

type SignatureVerifier interface {
	VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error)
}

type Status

type Status struct {
	SectorStates map[api.SectorState]int
	Workers      []*worker
}

type StorageAsk

type StorageAsk struct {
	// Price per GiB / Epoch
	Price         abi.TokenAmount
	VerifiedPrice abi.TokenAmount

	MinPieceSize abi.PaddedPieceSize
	MaxPieceSize abi.PaddedPieceSize
	Miner        address.Address
}

StorageAsk defines the parameters by which a miner will choose to accept or reject a deal. Note: making a storage deal proposal which matches the miner's ask is a precondition, but not sufficient to ensure the deal is accepted (the storage provider may run its own decision logic).

func (*StorageAsk) MarshalCBOR

func (t *StorageAsk) MarshalCBOR(w io.Writer) error

func (*StorageAsk) UnmarshalCBOR

func (t *StorageAsk) UnmarshalCBOR(r io.Reader) (err error)

type Transfer

type Transfer struct {
	// The type of transfer eg "http"
	Type string
	// An optional ID that can be supplied by the client to identify the deal
	ClientID string
	// A byte array containing marshalled data specific to the transfer type
	// eg a JSON encoded struct { URL: "<url>", Headers: {...} }
	Params []byte
	// The size of the data transferred in bytes
	Size uint64
}

Transfer has the parameters for a data transfer

func (*Transfer) Host

func (t *Transfer) Host() (string, error)

func (*Transfer) MarshalCBOR

func (t *Transfer) MarshalCBOR(w io.Writer) error

func (*Transfer) UnmarshalCBOR

func (t *Transfer) UnmarshalCBOR(r io.Reader) (err error)

type TransferState

type TransferState struct {
	ID         string
	LocalAddr  string
	RemoteAddr string
	Status     TransferStatus
	Sent       uint64
	Received   uint64
	Message    string
	PayloadCid cid.Cid
}

TransferState describes a transfer's current state

type TransferStatus

type TransferStatus string

TransferStatus describes the status of a transfer (started, completed etc)

const (
	// TransferStatusStarted is set when the transfer starts
	TransferStatusStarted TransferStatus = "TransferStatusStarted"
	// TransferStatusStarted is set when the transfer restarts after previously starting
	TransferStatusRestarted TransferStatus = "TransferStatusRestarted"
	TransferStatusOngoing   TransferStatus = "TransferStatusOngoing"
	TransferStatusCompleted TransferStatus = "TransferStatusCompleted"
	TransferStatusFailed    TransferStatus = "TransferStatusFailed"
)

type TransportDealInfo

type TransportDealInfo struct {
	OutputFile string
	DealUuid   uuid.UUID
	DealSize   int64
}

TransportDealInfo has parameters for a transfer to be executed

type TransportEvent

type TransportEvent struct {
	NBytesReceived int64
	Error          error
}

TransportEvent is fired as a transfer progresses

type TransportUrl

type TransportUrl struct {
	Scheme    string
	Url       string
	PeerID    peer.ID
	Multiaddr multiaddr.Multiaddr
}

func ParseUrl

func ParseUrl(urlStr string) (*TransportUrl, error)

Jump to

Keyboard shortcuts

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