replication

package
v0.2.39 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0, MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageProposalV120 = "/fil/storage/mk/1.2.0"
	StorageProposalV111 = "/fil/storage/mk/1.1.1"
)

Variables

View Source
var ErrNoDatacap = errors.New("no wallets have enough datacap")
View Source
var ErrNoWallet = errors.New("no wallets to choose from")

Functions

func EpochToTime

func EpochToTime(epoch abi.ChainEpoch) time.Time

func TimeToEpoch

func TimeToEpoch(t time.Time) abi.ChainEpoch

Types

type DatacapWalletChooser added in v0.2.21

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

func NewDatacapWalletChooser added in v0.2.21

func NewDatacapWalletChooser(db *gorm.DB, cacheTTL time.Duration,
	lotusAPI string, lotusToken string, min uint64) DatacapWalletChooser

func (DatacapWalletChooser) Choose added in v0.2.21

func (w DatacapWalletChooser) Choose(ctx context.Context, wallets []model.Wallet) (model.Wallet, error)

type DealConfig added in v0.2.23

type DealConfig struct {
	Provider        string
	StartDelay      time.Duration
	Duration        time.Duration
	Verified        bool
	HTTPHeaders     []string
	URLTemplate     string
	KeepUnsealed    bool
	AnnounceToIPNI  bool
	PricePerDeal    float64
	PricePerGB      float64
	PricePerGBEpoch float64
}

func (DealConfig) GetPrice added in v0.2.23

func (d DealConfig) GetPrice(pieceSize int64, duration time.Duration) big.Int

type DealMaker

type DealMaker interface {
	MakeDeal(ctx context.Context, walletObj model.Wallet, car model.Car, dealConfig DealConfig) (*model.Deal, error)
}

type DealMakerImpl added in v0.2.23

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

func NewDealMaker

func NewDealMaker(
	lotusClient jsonrpc.RPCClient,
	libp2p host.Host,
	cacheTTL time.Duration,
	requestTimeout time.Duration) DealMakerImpl

func (DealMakerImpl) Close added in v0.2.23

func (d DealMakerImpl) Close() error

func (DealMakerImpl) MakeDeal added in v0.2.23

func (d DealMakerImpl) MakeDeal(ctx context.Context, walletObj model.Wallet,
	car model.Car, dealConfig DealConfig) (*model.Deal, error)

type DealProviderCollateralBound

type DealProviderCollateralBound struct {
	Min string
	Max string
}

type DefaultWalletChooser added in v0.2.21

type DefaultWalletChooser struct{}

func (DefaultWalletChooser) Choose added in v0.2.21

func (w DefaultWalletChooser) Choose(ctx context.Context, wallets []model.Wallet) (model.Wallet, error)

type MinerInfo

type MinerInfo struct {
	PeerIDEncoded           string `json:"PeerID"`
	PeerID                  peer.ID
	MultiaddrsBase64Encoded []string `json:"Multiaddrs"`
	Multiaddrs              []multiaddr.Multiaddr
}

nolint: tagliatelle

type WalletChooser

type WalletChooser interface {
	Choose(ctx context.Context, wallets []model.Wallet) (model.Wallet, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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