miner

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaimMinerBody

type ClaimMinerBody struct {
	Miner address.Address `json:"miner"`
	Claim string          `json:"claim"`
	Name  string          `json:"name"`
}

type IMinerManager

type IMinerManager interface {
	EstimatePrice(ctx context.Context, repl int, pieceSize abi.PaddedPieceSize, duration abi.ChainEpoch, verified bool) (*estimateResponse, error)
	PickMiners(ctx context.Context, n int, pieceSize abi.PaddedPieceSize, exclude map[address.Address]bool, filterByPrice bool) ([]miner, error)
	GetDealProtocolForMiner(ctx context.Context, miner address.Address) (protocol.ID, error)
	ComputeSortedMinerList() ([]*minerDealStats, error)
	SortedMinerList() ([]address.Address, []*minerDealStats, error)
	GetAsk(ctx context.Context, m address.Address, maxCacheAge time.Duration) (*model.MinerStorageAsk, error)
	SetMinerInfo(m address.Address, params MinerSetInfoParams, u *util.User) error
	GetMsgForMinerClaim(miner address.Address, uid uint) []byte
	GetMinerChainInfo(ctx context.Context, maddr address.Address) (*MinerChainInfo, error)
	ClaimMiner(ctx context.Context, params ClaimMinerBody, u *util.User) error
	SuspendMiner(m address.Address, params SuspendMinerBody, u *util.User) error
	UnSuspendMiner(m address.Address, u *util.User) error
}

func NewMinerManager

func NewMinerManager(db *gorm.DB, fc *filclient.FilClient, cfg *config.Estuary, api api.Gateway, log *zap.SugaredLogger) IMinerManager

type MinerChainInfo added in v0.3.9

type MinerChainInfo struct {
	PeerID    string   `json:"peerId"`
	Addresses []string `json:"addresses"`

	Owner  string `json:"owner"`
	Worker string `json:"worker"`
}

type MinerManager

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

func (*MinerManager) ClaimMiner

func (mm *MinerManager) ClaimMiner(ctx context.Context, params ClaimMinerBody, u *util.User) error

func (*MinerManager) ComputeSortedMinerList

func (mm *MinerManager) ComputeSortedMinerList() ([]*minerDealStats, error)

func (*MinerManager) EstimatePrice

func (mm *MinerManager) EstimatePrice(ctx context.Context, repl int, pieceSize abi.PaddedPieceSize, duration abi.ChainEpoch, verified bool) (*estimateResponse, error)

func (*MinerManager) GetAsk

func (mm *MinerManager) GetAsk(ctx context.Context, m address.Address, maxCacheAge time.Duration) (*model.MinerStorageAsk, error)

func (*MinerManager) GetDealProtocolForMiner

func (mm *MinerManager) GetDealProtocolForMiner(ctx context.Context, miner address.Address) (protocol.ID, error)

func (*MinerManager) GetMinerChainInfo added in v0.3.9

func (mm *MinerManager) GetMinerChainInfo(ctx context.Context, maddr address.Address) (*MinerChainInfo, error)

func (*MinerManager) GetMsgForMinerClaim

func (mm *MinerManager) GetMsgForMinerClaim(miner address.Address, uid uint) []byte

func (*MinerManager) PickMiners

func (mm *MinerManager) PickMiners(ctx context.Context, n int, pieceSize abi.PaddedPieceSize, exclude map[address.Address]bool, filterByPrice bool) ([]miner, error)

func (*MinerManager) SetMinerInfo

func (mm *MinerManager) SetMinerInfo(m address.Address, params MinerSetInfoParams, u *util.User) error

func (*MinerManager) SortedMinerList

func (mm *MinerManager) SortedMinerList() ([]address.Address, []*minerDealStats, error)

func (*MinerManager) SuspendMiner

func (mm *MinerManager) SuspendMiner(m address.Address, params SuspendMinerBody, u *util.User) error

func (*MinerManager) UnSuspendMiner

func (mm *MinerManager) UnSuspendMiner(m address.Address, u *util.User) error

type MinerSetInfoParams

type MinerSetInfoParams struct {
	Name string `json:"name"`
}

type SuspendMinerBody

type SuspendMinerBody struct {
	Reason string `json:"reason"`
}

Jump to

Keyboard shortcuts

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