renter

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PhaseInitial              = "initial"
	PhaseDownloadOptimization = "download_optimization"
	FullRedundancyMultiplier  = 1.5 // Standard redundancy for initial phase
	MinRedundancyMultiplier   = 1.2 // Minimum redundancy during download optimization
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowlistTracker added in v0.3.0

type AllowlistTracker map[types.PublicKey]struct{}

type BatchResult added in v0.3.0

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

func NewBatchResult added in v0.3.0

func NewBatchResult(hosts []HostscoreHost, newHosts []HostscoreHost) BatchResult

type EvaluationState added in v0.3.0

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

func NewEvaluationState added in v0.3.0

func NewEvaluationState(config api.AutopilotConfig, consensusState api.ConsensusState,
	fee types.Currency, redundancy api.RedundancySettings, renter core.RenterService) *EvaluationState

func (*EvaluationState) EvaluateHosts added in v0.3.0

func (e *EvaluationState) EvaluateHosts(settings api.GougingSettings, hosts []HostscoreHost) (api.ConfigEvaluationResponse, error)

type HostManager added in v0.3.0

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

func NewHostManager added in v0.3.0

func NewHostManager(ctx core.Context) *HostManager

func (*HostManager) Init added in v0.3.0

func (t *HostManager) Init() error

func (*HostManager) RegisterTasks added in v0.3.0

func (t *HostManager) RegisterTasks(crn core.CronService) error

func (*HostManager) ScheduleJobs added in v0.3.0

func (t *HostManager) ScheduleJobs(crn core.CronService) error

type HostScanner added in v0.3.0

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

func NewHostScanner added in v0.3.0

func NewHostScanner(ctx core.Context) *HostScanner

func (*HostScanner) ScanForHosts added in v0.3.0

func (s *HostScanner) ScanForHosts(ctx core.Context) error

ScanForHosts performs the complete host scanning workflow

type HostscoreHost added in v0.3.0

type HostscoreHost struct {
	ID           int                  `json:"id"`
	Rank         int                  `json:"rank"`
	PublicKey    types.PublicKey      `json:"publicKey"`
	FirstSeen    time.Time            `json:"firstSeen"`
	KnownSince   uint64               `json:"knownSince"`
	NetAddress   string               `json:"netaddress"`
	Blocked      bool                 `json:"blocked"`
	IPNets       []string             `json:"ipNets"`
	LastIPChange time.Time            `json:"lastIPChange"`
	Settings     rhpv2.HostSettings   `json:"settings"`
	PriceTable   rhpv3.HostPriceTable `json:"priceTable"`
}

type HostscoreHostResponse added in v0.3.0

type HostscoreHostResponse struct {
	Hosts []HostscoreHost `json:"hosts"`
}

type PriceTracking added in v0.3.0

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

func NewPriceTracking added in v0.3.0

func NewPriceTracking(baseSettings api.GougingSettings, requiredHosts uint64, evalState *EvaluationState, logger *core.Logger) *PriceTracking

func (*PriceTracking) ComputeMaxPrices added in v0.3.0

func (pt *PriceTracking) ComputeMaxPrices() api.GougingSettings

func (*PriceTracking) ComputeOptimizedPrices added in v0.3.0

func (pt *PriceTracking) ComputeOptimizedPrices() (api.GougingSettings, int, bool)

func (*PriceTracking) GetAllHosts added in v0.3.0

func (pt *PriceTracking) GetAllHosts() []HostscoreHost

func (*PriceTracking) GetCurrentRankCutoff added in v0.3.0

func (pt *PriceTracking) GetCurrentRankCutoff() int

func (*PriceTracking) GetRequiredHosts added in v0.3.0

func (pt *PriceTracking) GetRequiredHosts() uint64

func (*PriceTracking) GetSearchBounds added in v0.3.0

func (pt *PriceTracking) GetSearchBounds() (low, high, best int)

func (*PriceTracking) GetValidHostCount added in v0.3.0

func (pt *PriceTracking) GetValidHostCount() uint64

func (*PriceTracking) HasEnoughHosts added in v0.3.0

func (pt *PriceTracking) HasEnoughHosts(usableHosts uint64) bool

func (*PriceTracking) RemoveHosts added in v0.3.0

func (pt *PriceTracking) RemoveHosts(toRemove []types.PublicKey)

func (*PriceTracking) UpdateOptimizationResult added in v0.3.0

func (pt *PriceTracking) UpdateOptimizationResult(rankWorked bool, testedRank int, usableHosts uint64)

func (*PriceTracking) UpdatePrices added in v0.3.0

func (pt *PriceTracking) UpdatePrices(hosts []HostscoreHost)

type ScanResult added in v0.3.0

type ScanResult struct {
	PublicKey types.PublicKey
	Success   bool
	Error     error
	Attempts  int
}

ScanResult represents the outcome of scanning a single host

type ScanState added in v0.3.0

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

func NewScanState added in v0.3.0

func NewScanState() *ScanState

func (*ScanState) AddHosts added in v0.3.0

func (s *ScanState) AddHosts(hosts []HostscoreHost)

func (*ScanState) GetScannedHostCount added in v0.3.0

func (s *ScanState) GetScannedHostCount() int

GetScannedHostCount returns total number of tracked hosts

func (*ScanState) GetScannedHosts added in v0.3.0

func (s *ScanState) GetScannedHosts() []HostscoreHost

GetScannedHosts returns all currently tracked hosts in a slice

type ScanTracker added in v0.3.0

type ScanTracker map[types.PublicKey]struct{}

Jump to

Keyboard shortcuts

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