localvalidator

package
v0.0.0-...-6e04e41 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: ISC Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type LocalValidator

type LocalValidator struct {
	validator.Validator
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(config *validator.Config, addrs []net.Addr) (*LocalValidator, error)

func (*LocalValidator) BecomeGenerator

func (v *LocalValidator) BecomeGenerator(height int32, handOverTime time.Time) error

func (*LocalValidator) ClearMyGenerator

func (v *LocalValidator) ClearMyGenerator()

Get My Generator , if local validators isnot a generator, it will return nil

func (*LocalValidator) ConfirmDelEpochMember

func (v *LocalValidator) ConfirmDelEpochMember(reqDelEpochMember *validatorcommand.MsgReqDelEpochMember, remoteAddr net.Addr) *epoch.DelEpochMember

Received a Del epoch member command

func (*LocalValidator) ContinueNextSlot

func (v *LocalValidator) ContinueNextSlot()

func (*LocalValidator) CreateToken

func (v *LocalValidator) CreateToken(tokenData []byte) (string, error)

func (*LocalValidator) GetAllValidators

func (v *LocalValidator) GetAllValidators(validatorID uint64) []*validatorinfo.ValidatorInfo

GetAllValidators invoke when the peer receiver GetValidators command.

func (*LocalValidator) GetGenerator

func (v *LocalValidator) GetGenerator(validatorId uint64) *generator.Generator

Get Generator info in local, it should be saved in manager

func (*LocalValidator) GetLocalEpoch

func (v *LocalValidator) GetLocalEpoch(validatorID uint64) (*epoch.Epoch, *epoch.Epoch, error)

GetAllValidators invoke when the peer receiver GetValidators command.

func (*LocalValidator) GetLocalValidatorInfo

func (v *LocalValidator) GetLocalValidatorInfo(uint64) *validatorinfo.ValidatorInfo

GetLocalValidatorInfo invoke when local validator info.

func (*LocalValidator) GetMyGenerator

func (v *LocalValidator) GetMyGenerator() *generator.Generator

Get My Generator , if local validators isnot a generator, it will return nil

func (*LocalValidator) GetVCBlock

func (v *LocalValidator) GetVCBlock(validatorId uint64, blockType uint32, hash chainhash.Hash) (*validatorcommand.MsgVCBlock, error)

Received get vc block command

func (*LocalValidator) GetVCList

func (v *LocalValidator) GetVCList(validatorId uint64, start int64, end int64) (*validatorcommand.MsgVCList, error)

Received get vc list command

func (*LocalValidator) GetVCState

func (v *LocalValidator) GetVCState(validatorId uint64) (*validatorcommand.MsgVCState, error)

Received get vc state command

func (*LocalValidator) GetValidatorAddrsList

func (v *LocalValidator) GetValidatorAddrsList() []net.Addr

func (*LocalValidator) IsBootStrapNode

func (v *LocalValidator) IsBootStrapNode() bool

func (*LocalValidator) OnAllValidatorsDeclare

func (v *LocalValidator) OnAllValidatorsDeclare(validatorList []validatorinfo.ValidatorInfo, remoteAddr net.Addr)

func (*LocalValidator) OnConfirmEpoch

func (v *LocalValidator) OnConfirmEpoch(epoch *epoch.Epoch, remoteAddr net.Addr)

Received a confirm epoch command

func (*LocalValidator) OnHandOverGenerator

func (v *LocalValidator) OnHandOverGenerator(handOverInfo generator.GeneratorHandOver, remoteAddr net.Addr)

func (*LocalValidator) OnNextEpoch

func (v *LocalValidator) OnNextEpoch(handoverEpoch *epoch.HandOverEpoch)

Handover to next epoch

func (*LocalValidator) OnNotifyHandover

func (v *LocalValidator) OnNotifyHandover(validatorId uint64, remoteAddr net.Addr)

Received a notify handover command

func (*LocalValidator) OnPeerConnected

func (v *LocalValidator) OnPeerConnected(addr net.Addr, validatorInfo *validatorinfo.ValidatorInfo)

OnPeerConnected is invoked when a remote peer connects to the local peer .

func (*LocalValidator) OnTimeGenerateBlock

func (v *LocalValidator) OnTimeGenerateBlock() (*chainhash.Hash, int32, error)

func (*LocalValidator) OnUpdateEpoch

func (v *LocalValidator) OnUpdateEpoch(updatedEpoch *epoch.Epoch)

Notify current epoch is updated

func (*LocalValidator) OnVCBlock

func (v *LocalValidator) OnVCBlock(vcblock *validatorcommand.MsgVCBlock, remoteAddr net.Addr)

Received a vc block command

func (*LocalValidator) ReqNewEpoch

func (v *LocalValidator) ReqNewEpoch(validatorID uint64, epochIndex int64, reason uint32) (*chainhash.Hash, error)

Req new epoch from remote peer

func (*LocalValidator) Start

func (v *LocalValidator) Start()

Addr returns the peer address.

This function is safe for concurrent access.

type ValidatorKey

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

func InitValidatorKey

func InitValidatorKey(path string, netParams *chaincfg.Params) (*ValidatorKey, error)

func (*ValidatorKey) GetPublicKey

func (v *ValidatorKey) GetPublicKey() ([]byte, error)

func (*ValidatorKey) SignData

func (v *ValidatorKey) SignData(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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