replication

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0, MIT Imports: 30 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, cacheDuration 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 DealMaker

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

func NewDealMaker

func NewDealMaker(lotusURL string, lotusToken string, libp2p host.Host) (*DealMaker, error)

func (DealMaker) GetProtocols

func (d DealMaker) GetProtocols(ctx context.Context, minerInfo peer.AddrInfo) ([]protocol.ID, error)

func (DealMaker) GetProviderInfo

func (d DealMaker) GetProviderInfo(ctx context.Context, provider string) (MinerInfo, error)

func (DealMaker) MakeDeal

func (d DealMaker) MakeDeal(ctx context.Context, now time.Time, walletObj model.Wallet,
	car model.Car, schedule model.Schedule, minerInfo peer.AddrInfo) (string, 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