peer

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBootstrapPeerTypeProvider added in v1.4.0

func NewBootstrapPeerTypeProvider() *bootstrapPeerTypeProvider

NewBootstrapPeerTypeProvider returns a new instance of bootstrapPeerTypeProvider It should be used for bootstrap only!

func NewInterceptedValidatorInfo added in v1.4.0

func NewInterceptedValidatorInfo(args ArgInterceptedValidatorInfo) (*interceptedValidatorInfo, error)

NewInterceptedValidatorInfo creates a new intercepted validator info instance

func NewValidatorStatisticsProcessor

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

NewValidatorStatisticsProcessor instantiates a new validatorStatistics structure responsible for keeping account of

each validator actions in the consensus process

func NewValidatorsProvider added in v0.0.5

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

NewValidatorsProvider instantiates a new validatorsProvider structure responsible for keeping account of

the latest information about the validators

Types

type ArgInterceptedValidatorInfo added in v1.4.0

type ArgInterceptedValidatorInfo struct {
	DataBuff    []byte
	Marshalizer marshal.Marshalizer
	Hasher      hashing.Hasher
}

ArgInterceptedValidatorInfo is the argument used to create a new intercepted validator info

type ArgPeerTypeProvider added in v1.0.117

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                     nodesCoordinator.NodesCoordinator
	ShardCoordinator                     sharding.Coordinator
	DataPool                             DataPool
	StorageService                       dataRetriever.StorageService
	PubkeyConv                           core.PubkeyConverter
	PeerAdapter                          state.AccountsAdapter
	Rater                                sharding.PeerAccountListAndRatingHandler
	RewardsHandler                       process.RewardsHandler
	MaxComputableRounds                  uint64
	MaxConsecutiveRoundsOfRatingDecrease uint64
	NodesSetup                           sharding.GenesisNodesSetupHandler
	GenesisNonce                         uint64
	RatingEnableEpoch                    uint32
	EnableEpochsHandler                  common.EnableEpochsHandler
}

ArgValidatorStatisticsProcessor holds all dependencies for the validatorStatistics

type ArgValidatorsProvider added in v1.0.120

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 added in v1.0.102

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 added in v1.0.102

func (liu *ListIndexUpdater) IsInterfaceNil() bool

IsInterfaceNil checks if the underlying object is nil

func (*ListIndexUpdater) UpdateListAndIndex added in v1.0.102

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 added in v1.0.117

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

PeerTypeProvider handles the computation of a peer type

func NewPeerTypeProvider added in v1.0.117

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

NewPeerTypeProvider will return a new instance of PeerTypeProvider

func (*PeerTypeProvider) ComputeForPubKey added in v1.0.117

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

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

func (*PeerTypeProvider) GetAllPeerTypeInfos added in v1.0.117

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

GetAllPeerTypeInfos returns all known peer type infos

func (*PeerTypeProvider) IsInterfaceNil added in v1.0.117

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