f3participant

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// maxCheckProgressAttempts defines the maximum number of failed attempts
	// before we abandon the current lease and restart the participation process.
	//
	// The default backoff takes 12 attempts to reach a maximum delay of 1 minute.
	// Allowing for 13 failures results in approximately 2 minutes of backoff since
	// the lease was granted. Given a lease validity of up to 5 instances, this means
	// we would give up on checking the lease during its mid-validity period;
	// typically when we would try to renew the participation ticket. Hence, the value
	// to 13.
	ParticipationCheckProgressMaxAttempts = 13

	// ParticipationLeaseTerm is the number of instances the miner will attempt to lease from nodes.
	ParticipationLeaseTerm = 5
)
View Source
const (

	// F3LeaseTerm The number of instances the miner will attempt to lease from nodes.
	F3LeaseTerm = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type F3ParticipationAPI

type F3ParticipationAPI interface {
	F3GetOrRenewParticipationTicket(ctx context.Context, minerID address.Address, previous types.F3ParticipationTicket, instances uint64) (types.F3ParticipationTicket, error) //perm:sign
	F3Participate(ctx context.Context, ticket types.F3ParticipationTicket) (types.F3ParticipationLease, error)
	F3GetProgress(ctx context.Context) (gpbft.Instant, error)
	F3GetManifest(ctx context.Context) (*manifest.Manifest, error)
}

type MultiParticipant

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

func NewMultiParticipant

func NewMultiParticipant(ctx helpers.MetricsCtx,
	node v1api.FullNode,
	minerManager miner_manager.MinerManageAPI,
) (*MultiParticipant, error)

func (*MultiParticipant) MonitorMiner

func (mp *MultiParticipant) MonitorMiner(ctx context.Context)

func (*MultiParticipant) Start

func (mp *MultiParticipant) Start(ctx context.Context) error

func (*MultiParticipant) Stop

func (mp *MultiParticipant) Stop(ctx context.Context) error

type Participant

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

func NewParticipant

func NewParticipant(ctx context.Context,
	node F3ParticipationAPI,
	participant address.Address,
	backoff *backoff.Backoff,
	maxCheckProgress int,
	leaseTerm uint64,
) *Participant

func (*Participant) Start

func (p *Participant) Start(ctx context.Context) error

func (*Participant) Stop

func (p *Participant) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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