peer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidatorStatisticsProcessor

func NewValidatorStatisticsProcessor(arguments ArgValidatorStatisticsProcessor) (*validatorStatistics, error)

NewValidatorStatisticsProcessor instantiates a new validatorStatistics structure responsible of keeping account of

each validator actions in the consensus process

func NewValidatorsProvider

func NewValidatorsProvider(
	args ArgValidatorsProvider,
) (*validatorsProvider, error)

NewValidatorsProvider instantiates a new validatorsProvider structure responsible of keeping account of

the latest information about the validators

Types

type ArgPeerTypeProvider

type ArgPeerTypeProvider struct {
	NodesCoordinator        process.NodesCoordinator
	StartEpoch              uint32
	EpochStartEventNotifier process.EpochStartEventNotifier
}

ArgPeerTypeProvider contains all parameters needed for creating a PeerTypeProvider

type ArgValidatorStatisticsProcessor

type ArgValidatorStatisticsProcessor struct {
	Marshalizer         marshal.Marshalizer
	NodesCoordinator    sharding.NodesCoordinator
	ShardCoordinator    sharding.Coordinator
	DataPool            DataPool
	StorageService      dataRetriever.StorageService
	PubkeyConv          core.PubkeyConverter
	PeerAdapter         state.AccountsAdapter
	Rater               sharding.PeerAccountListAndRatingHandler
	RewardsHandler      process.RewardsHandler
	MaxComputableRounds uint64
	NodesSetup          sharding.GenesisNodesSetupHandler
	GenesisNonce        uint64
	RatingEnableEpoch   uint32
}

ArgValidatorStatisticsProcessor holds all dependencies for the validatorStatistics

type ArgValidatorsProvider

type ArgValidatorsProvider struct {
	NodesCoordinator                  process.NodesCoordinator
	EpochStartEventNotifier           process.EpochStartEventNotifier
	CacheRefreshIntervalDurationInSec time.Duration
	ValidatorStatistics               process.ValidatorStatisticsProcessor
	PubKeyConverter                   core.PubkeyConverter
	StartEpoch                        uint32
	MaxRating                         uint32
}

ArgValidatorsProvider contains all parameters needed for creating a validatorsProvider

type DataPool

type DataPool interface {
	Headers() dataRetriever.HeadersPool
	IsInterfaceNil() bool
}

DataPool indicates the main functionality needed in order to fetch the required blocks from the pool

type ListIndexUpdater

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

ListIndexUpdater will handle the updating of list type and the index for a peer

func (*ListIndexUpdater) IsInterfaceNil

func (liu *ListIndexUpdater) IsInterfaceNil() bool

IsInterfaceNil checks if the underlying object is nil

func (*ListIndexUpdater) UpdateListAndIndex

func (liu *ListIndexUpdater) UpdateListAndIndex(pubKey string, shardID uint32, list string, index uint32) error

UpdateListAndIndex will update the list and the index for a given peer

type PeerTypeProvider

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

PeerTypeProvider handles the computation of a peer type

func NewPeerTypeProvider

func NewPeerTypeProvider(arg ArgPeerTypeProvider) (*PeerTypeProvider, error)

NewPeerTypeProvider will return a new instance of PeerTypeProvider

func (*PeerTypeProvider) ComputeForPubKey

func (ptp *PeerTypeProvider) ComputeForPubKey(pubKey []byte) (core.PeerType, uint32, error)

ComputeForPubKey returns the peer type for a given public key and shard id

func (*PeerTypeProvider) GetAllPeerTypeInfos

func (ptp *PeerTypeProvider) GetAllPeerTypeInfos() []*state.PeerTypeInfo

GetAllPeerTypeInfos returns all known peer type infos

func (*PeerTypeProvider) IsInterfaceNil

func (ptp *PeerTypeProvider) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type RatingReader

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

RatingReader will handle the fetching of the ratings

func (*RatingReader) GetRating

func (bsr *RatingReader) GetRating(pk string) uint32

GetRating returns the Rating for the specified public key

func (*RatingReader) IsInterfaceNil

func (bsr *RatingReader) IsInterfaceNil() bool

IsInterfaceNil checks if the underlying object is nil

Jump to

Keyboard shortcuts

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