keysManagement

package
v0.0.0-...-08f901d Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicatedKey = errors.New("duplicated key found")

ErrDuplicatedKey signals that a key is already managed by the node

View Source
var ErrEmptyPeerID = errors.New("empty peer ID")

ErrEmptyPeerID signals that an empty peer ID was provided

View Source
var ErrInvalidKey = errors.New("invalid key")

ErrInvalidKey signals that an invalid key was provided

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue signals that an invalid value was provided

View Source
var ErrMissingPublicKeyDefinition = errors.New("missing public key definition")

ErrMissingPublicKeyDefinition signals that a public key definition is missing

View Source
var ErrNilEpochProvider = errors.New("nil epoch provider")

ErrNilEpochProvider signals that a nil epoch provider has been provided

View Source
var ErrNilKeyGenerator = errors.New("nil key generator")

ErrNilKeyGenerator signals that a nil key generator was provided

View Source
var ErrNilManagedPeersHolder = errors.New("nil managed peers holder")

ErrNilManagedPeersHolder signals that a nil managed peers holder was provided

View Source
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")

ErrNilNodesCoordinator signals that a nil nodes coordinator has been provided

View Source
var ErrNilP2PKeyConverter = errors.New("nil p2p key converter")

ErrNilP2PKeyConverter signals that a nil p2p key converter has been provided

View Source
var ErrNilPrivateKey = errors.New("nil private key")

ErrNilPrivateKey signals that a nil private key was provided

View Source
var ErrNilShardProvider = errors.New("nil shard provider")

ErrNilShardProvider signals that a nil shard provider has been provided

Functions

func NewKeysHandler

func NewKeysHandler(args ArgsKeysHandler) (*keysHandler, error)

NewKeysHandler will create a new instance of type keysHandler

func NewManagedPeersHolder

func NewManagedPeersHolder(args ArgsManagedPeersHolder) (*managedPeersHolder, error)

NewManagedPeersHolder creates a new instance of a managed peers holder

func NewManagedPeersMonitor

func NewManagedPeersMonitor(args ArgManagedPeersMonitor) (*managedPeersMonitor, error)

NewManagedPeersMonitor returns a new instance of managedPeersMonitor

Types

type ArgManagedPeersMonitor

type ArgManagedPeersMonitor struct {
	ManagedPeersHolder common.ManagedPeersHolder
	NodesCoordinator   NodesCoordinator
	ShardProvider      ShardProvider
	EpochProvider      CurrentEpochProvider
}

ArgManagedPeersMonitor is the DTO used to create a new instance of managedPeersMonitor

type ArgsKeysHandler

type ArgsKeysHandler struct {
	ManagedPeersHolder common.ManagedPeersHolder
	PrivateKey         crypto.PrivateKey
	Pid                core.PeerID
}

ArgsKeysHandler is the argument DTO struct for the NewKeysHandler constructor function

type ArgsManagedPeersHolder

type ArgsManagedPeersHolder struct {
	KeyGenerator          crypto.KeyGenerator
	P2PKeyGenerator       crypto.KeyGenerator
	MaxRoundsOfInactivity int
	PrefsConfig           config.Preferences
	P2PKeyConverter       p2p.P2PKeyConverter
}

ArgsManagedPeersHolder represents the argument for the managed peers holder

type CurrentEpochProvider

type CurrentEpochProvider interface {
	CurrentEpoch() uint32
	IsInterfaceNil() bool
}

CurrentEpochProvider defines a component able to provide current epoch

type NodesCoordinator

type NodesCoordinator interface {
	GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
	GetAllWaitingValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
	IsInterfaceNil() bool
}

NodesCoordinator provides Validator methods needed for the peer processing

type ShardProvider

type ShardProvider interface {
	SelfId() uint32
	IsInterfaceNil() bool
}

ShardProvider defines a component able to provide self shard

Jump to

Keyboard shortcuts

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