validation

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILECOIN_EPOCH_DURATION   = 30
	GAME_CHAIN_EPOCH_LOOKBACK = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager validation manager

func NewManager

func NewManager(nodeMgr *node.Manager, assetMgr *assets.Manager, configFunc dtypes.GetSchedulerConfigFunc, p *pubsub.PubSub, lmgr *leadership.Manager) *Manager

NewManager return new node manager instance

func (*Manager) CompulsoryElection added in v0.1.13

func (m *Manager) CompulsoryElection(validators []string) error

func (*Manager) GetNextElectionTime

func (m *Manager) GetNextElectionTime() time.Time

GetNextElectionTime Get the time of the next election

func (*Manager) PairValidatorsAndValidatableNodes

func (m *Manager) PairValidatorsAndValidatableNodes() []*VWindow

PairValidatorsAndValidatableNodes randomly pair validators and validatable nodes based on their bandwidth capabilities.

func (*Manager) PushResult added in v0.1.10

func (m *Manager) PushResult(vr *api.ValidationResult)

PushResult push validation result info to queue

func (*Manager) ResetValidatorGroup

func (m *Manager) ResetValidatorGroup(validators, validatables []string)

ResetValidatorGroup clears and initializes the validator and validatable groups

func (*Manager) Start

func (m *Manager) Start(ctx context.Context)

Start start validate and elect task

func (*Manager) StartElection

func (m *Manager) StartElection()

StartElection triggers an election manually.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop stop

type VWindow

type VWindow struct {
	NodeID           string // Node ID of the validation window.
	ValidatableNodes map[string]int64
}

VWindow represents a validation window that contains a validator id and validatable node list.

type ValidatableGroup

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

ValidatableGroup Each ValidatableGroup will be paired with a VWindow

Jump to

Keyboard shortcuts

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