Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateChunkSize(fileSize int64) int
- func DerefOr[T any](v *T, def T) T
- func GetAddrInfo(ctx context.Context, api api.Gateway, maddr address.Address) (*peer.AddrInfo, error)
- func IsPublicOrDNSAddr(a multiaddr.Multiaddr) bool
- func Open(root string, opts ...OpenOption) (iface.RIBS, error)
- type ErrRejected
- type GroupDealStats
- type LimitWriter
- type OpenOption
- type ProbingRetrievalFinder
- type ProviderAddrInfo
- type RetrCandidate
- type RetrCheckCandidate
- type RetrievalResult
- type TransferInfo
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 GetAddrInfo ¶
func IsPublicOrDNSAddr ¶
func IsPublicOrDNSAddr(a multiaddr.Multiaddr) bool
Types ¶
type ErrRejected ¶
type ErrRejected struct {
Reason string
}
func (ErrRejected) Error ¶
func (e ErrRejected) Error() string
type GroupDealStats ¶
type LimitWriter ¶
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 RetrCheckCandidate ¶
type RetrievalResult ¶
Click to show internal directories.
Click to hide internal directories.