Documentation ¶
Index ¶
- func DisableLog()
- func UseLogger(logger btclog.Logger)
- type LocalValidator
- func (v *LocalValidator) BecomeGenerator(height int32, handOverTime time.Time) error
- func (v *LocalValidator) ClearMyGenerator()
- func (v *LocalValidator) ConfirmDelEpochMember(reqDelEpochMember *validatorcommand.MsgReqDelEpochMember, remoteAddr net.Addr) *epoch.DelEpochMember
- func (v *LocalValidator) ContinueNextSlot()
- func (v *LocalValidator) CreateToken(tokenData []byte) (string, error)
- func (v *LocalValidator) GetAllValidators(validatorID uint64) []*validatorinfo.ValidatorInfo
- func (v *LocalValidator) GetGenerator(validatorId uint64) *generator.Generator
- func (v *LocalValidator) GetLocalEpoch(validatorID uint64) (*epoch.Epoch, *epoch.Epoch, error)
- func (v *LocalValidator) GetLocalValidatorInfo(uint64) *validatorinfo.ValidatorInfo
- func (v *LocalValidator) GetMyGenerator() *generator.Generator
- func (v *LocalValidator) GetVCBlock(validatorId uint64, blockType uint32, hash chainhash.Hash) (*validatorcommand.MsgVCBlock, error)
- func (v *LocalValidator) GetVCList(validatorId uint64, start int64, end int64) (*validatorcommand.MsgVCList, error)
- func (v *LocalValidator) GetVCState(validatorId uint64) (*validatorcommand.MsgVCState, error)
- func (v *LocalValidator) GetValidatorAddrsList() []net.Addr
- func (v *LocalValidator) IsBootStrapNode() bool
- func (v *LocalValidator) OnAllValidatorsDeclare(validatorList []validatorinfo.ValidatorInfo, remoteAddr net.Addr)
- func (v *LocalValidator) OnConfirmEpoch(epoch *epoch.Epoch, remoteAddr net.Addr)
- func (v *LocalValidator) OnHandOverGenerator(handOverInfo generator.GeneratorHandOver, remoteAddr net.Addr)
- func (v *LocalValidator) OnNextEpoch(handoverEpoch *epoch.HandOverEpoch)
- func (v *LocalValidator) OnNotifyHandover(validatorId uint64, remoteAddr net.Addr)
- func (v *LocalValidator) OnPeerConnected(addr net.Addr, validatorInfo *validatorinfo.ValidatorInfo)
- func (v *LocalValidator) OnTimeGenerateBlock() (*chainhash.Hash, int32, error)
- func (v *LocalValidator) OnUpdateEpoch(updatedEpoch *epoch.Epoch)
- func (v *LocalValidator) OnVCBlock(vcblock *validatorcommand.MsgVCBlock, remoteAddr net.Addr)
- func (v *LocalValidator) ReqNewEpoch(validatorID uint64, epochIndex int64, reason uint32) (*chainhash.Hash, error)
- func (v *LocalValidator) Start()
- type ValidatorKey
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.
Types ¶
type LocalValidator ¶
func NewValidator ¶
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 ¶
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)