rbdeal

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

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0, MIT Imports: 90 Imported by: 0

Documentation

Index

Constants

View Source
const AskProtocolID = "/fil/storage/ask/1.1.0"
View Source
const AvgBlockSize = 256 << 10
View Source
const BlockCacheSize = BlockCacheSizeMiB << 20 / AvgBlockSize
View Source
const BlockCacheSizeMiB = 512
View Source
const DealProtocolv120 = "/fil/storage/mk/1.2.0"
View Source
const DealStatusV12ProtocolID = "/fil/storage/status/1.2.0"
View Source
const RetrievalCandidateCacheSize = 10000
View Source
const RetrievalCandidateTimeout = 5 * time.Minute

Variables

View Source
var DealCheckInterval = 10 * time.Second
View Source
var ParallelDealChecks = 10
View Source
var RepairCheckInterval = time.Minute

Functions

func CalculateChunkSize

func CalculateChunkSize(fileSize int64) int

func DerefOr

func DerefOr[T any](v *T, def T) T

func GetAddrInfo

func GetAddrInfo(ctx context.Context, api api.Gateway, maddr address.Address) (*peer.AddrInfo, error)

func IsPublicOrDNSAddr

func IsPublicOrDNSAddr(a multiaddr.Multiaddr) bool

func Open

func Open(root string, opts ...OpenOption) (iface.RIBS, error)

Types

type ErrRejected

type ErrRejected struct {
	Reason string
}

func (ErrRejected) Error

func (e ErrRejected) Error() string

type GroupDealStats

type GroupDealStats struct {
	GroupID        int64
	State          iface.GroupState
	TotalDeals     int64
	PublishedDeals int64
	SealedDeals    int64
	FailedDeals    int64
	RejectedDeals  int64
	Retrievable    int64
	Unretrievable  int64
}

type LimitWriter

type LimitWriter struct {
	W       io.Writer
	N       int64
	Err     error
	Reached bool // flag to indicate whether the limit has been reached
}

func (*LimitWriter) Write

func (lw *LimitWriter) Write(p []byte) (n int, err error)

type OpenOption

type OpenOption func(*openOptions)

func WithFileCoinApiEndpoint

func WithFileCoinApiEndpoint(wp string) OpenOption

WithFileCoinApiEndpoint sets the FileCoin API endpoint used to probe the chain. Defaults to "https://api.chain.love/rpc/v1".

func WithHostGetter

func WithHostGetter(hg func(...libp2p.Option) (host.Host, error)) OpenOption

WithHostGetter sets the function used to instantiate the libp2p host used by RIBS. Defaults to libp2p.New.

func WithLocalWalletOpener

func WithLocalWalletOpener(wg func(path string) (*ributil.LocalWallet, error)) OpenOption

WithLocalWalletOpener sets the function used to open the local wallet path. Defaults to using ributil.OpenWallet, where the wallet is instantiated if it does not exist. In a case where it is auto generated, the wallet path must be backed up elsewhere.

See: WithLocalWalletPath.

func WithLocalWalletPath

func WithLocalWalletPath(wp string) OpenOption

WithLocalWalletPath sets the path to the local directory containing the wallet. Care must be taken in backing up this directory. Defaults to `.ribswallet` under user home directory.

type ProbingRetrievalFinder

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

func (*ProbingRetrievalFinder) FindCandidates

func (p *ProbingRetrievalFinder) FindCandidates(ctx context.Context, cid cid.Cid, f func(types.RetrievalCandidate)) error

type ProviderAddrInfo

type ProviderAddrInfo struct {
	LibP2PMaddrs  []multiaddr.Multiaddr
	BitswapMaddrs []multiaddr.Multiaddr
	HttpMaddrs    []multiaddr.Multiaddr
}

type RetrCandidate

type RetrCandidate struct {
	DealID                    string
	Provider                  int64
	Verified                  bool
	FastRetr                  bool
	LastRetrievalCheckSuccess int64
}

type RetrCheckCandidate

type RetrCheckCandidate struct {
	DealID   string
	Provider int64
	Group    int64
	Verified bool
	FastRetr bool
}

type RetrievalResult

type RetrievalResult struct {
	Success bool
	Error   string

	Duration        time.Duration
	TimeToFirstByte time.Duration
}

type TransferInfo

type TransferInfo struct {
	Failed                 int
	CarTransferAttempts    int
	CarTransferStartTime   *int64
	CarTransferLastBytes   *int64
	CarTransferLastEndTime *int64
}

Jump to

Keyboard shortcuts

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