Documentation ¶
Overview ¶
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Index ¶
- type ChainReader
- type DPosVoteRing
- type DPosVoteState
- type MessageCenterInterface
- type MessageSendInterface
- type NodeOnLineInfo
- type StateReaderInterface
- type TopNodeInstance
- func (self *TopNodeInstance) GetTopNodeOnlineState() []NodeOnLineInfo
- func (self *TopNodeInstance) IsSelfAddress(addr common.Address) bool
- func (self *TopNodeInstance) PublishEvent(aim mc.EventCode, data interface{}) error
- func (self *TopNodeInstance) SendNodeMsg(subCode mc.EventCode, msg interface{}, Roles common.RoleType, ...)
- func (self *TopNodeInstance) SignWithValidate(hash []byte, validate bool, blkhash common.Hash) (sig common.Signature, err error)
- func (self *TopNodeInstance) SubscribeEvent(aim mc.EventCode, ch interface{}) (event.Subscription, error)
- type TopNodeService
- func (serv *TopNodeService) Close()
- func (serv *TopNodeService) GetConsensusOnlineResults() []*mc.HD_OnlineConsensusVoteResultMsg
- func (serv *TopNodeService) LeaderChangeNotifyHandler(leader common.Address)
- func (serv *TopNodeService) OnlineConsensusVoteResultMsgHandler(msg *mc.HD_OnlineConsensusVoteResultMsg)
- func (serv *TopNodeService) SetMessageCenterInterface(inter MessageCenterInterface)
- func (serv *TopNodeService) SetMessageSendInterface(inter MessageSendInterface)
- func (serv *TopNodeService) SetStateReaderInterface(inter StateReaderInterface)
- func (serv *TopNodeService) SetTopNodeStateInterface(inter TopNodeStateInterface)
- func (serv *TopNodeService) SetValidatorAccountInterface(inter ValidatorAccountInterface)
- func (serv *TopNodeService) SetValidatorReader(reader consensus.StateReader)
- func (serv *TopNodeService) Start() error
- type TopNodeStateInterface
- type ValidatorAccountInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainReader ¶
type ChainReader interface { DPOSEngine(version []byte) consensus.DPOSEngine CurrentBlock() *types.Block }
type DPosVoteRing ¶
type DPosVoteRing struct { DPosVoteS []*DPosVoteState // contains filtered or unexported fields }
func NewDPosVoteRing ¶
func NewDPosVoteRing(capacity int) *DPosVoteRing
type DPosVoteState ¶
type MessageCenterInterface ¶
type MessageSendInterface ¶
type NodeOnLineInfo ¶
type StateReaderInterface ¶
type StateReaderInterface interface { GetTopologyGraphByHash(blockHash common.Hash) (*mc.TopologyGraph, error) GetElectOnlineStateByHash(blockHash common.Hash) (*mc.ElectOnlineStatus, error) }
type TopNodeInstance ¶
type TopNodeInstance struct {
// contains filtered or unexported fields
}
//////////////////////////////////////////////////////////////////
func NewTopNodeInstance ¶
func NewTopNodeInstance(sh *signhelper.SignHelper, hd *msgsend.HD) *TopNodeInstance
func (*TopNodeInstance) GetTopNodeOnlineState ¶
func (self *TopNodeInstance) GetTopNodeOnlineState() []NodeOnLineInfo
func (*TopNodeInstance) IsSelfAddress ¶
func (self *TopNodeInstance) IsSelfAddress(addr common.Address) bool
func (*TopNodeInstance) PublishEvent ¶
func (self *TopNodeInstance) PublishEvent(aim mc.EventCode, data interface{}) error
func (*TopNodeInstance) SendNodeMsg ¶
func (*TopNodeInstance) SignWithValidate ¶
func (*TopNodeInstance) SubscribeEvent ¶
func (self *TopNodeInstance) SubscribeEvent(aim mc.EventCode, ch interface{}) (event.Subscription, error)
type TopNodeService ¶
type TopNodeService struct {
// contains filtered or unexported fields
}
func NewTopNodeService ¶
func NewTopNodeService(cr ChainReader) *TopNodeService
func (*TopNodeService) Close ¶
func (serv *TopNodeService) Close()
func (*TopNodeService) GetConsensusOnlineResults ¶
func (serv *TopNodeService) GetConsensusOnlineResults() []*mc.HD_OnlineConsensusVoteResultMsg
提供需要上区块头的顶点共识结果,只有leader调用
func (*TopNodeService) LeaderChangeNotifyHandler ¶
func (serv *TopNodeService) LeaderChangeNotifyHandler(leader common.Address)
func (*TopNodeService) OnlineConsensusVoteResultMsgHandler ¶
func (serv *TopNodeService) OnlineConsensusVoteResultMsgHandler(msg *mc.HD_OnlineConsensusVoteResultMsg)
func (*TopNodeService) SetMessageCenterInterface ¶
func (serv *TopNodeService) SetMessageCenterInterface(inter MessageCenterInterface)
func (*TopNodeService) SetMessageSendInterface ¶
func (serv *TopNodeService) SetMessageSendInterface(inter MessageSendInterface)
func (*TopNodeService) SetStateReaderInterface ¶
func (serv *TopNodeService) SetStateReaderInterface(inter StateReaderInterface)
func (*TopNodeService) SetTopNodeStateInterface ¶
func (serv *TopNodeService) SetTopNodeStateInterface(inter TopNodeStateInterface)
func (*TopNodeService) SetValidatorAccountInterface ¶
func (serv *TopNodeService) SetValidatorAccountInterface(inter ValidatorAccountInterface)
func (*TopNodeService) SetValidatorReader ¶
func (serv *TopNodeService) SetValidatorReader(reader consensus.StateReader)
func (*TopNodeService) Start ¶
func (serv *TopNodeService) Start() error
type TopNodeStateInterface ¶
type TopNodeStateInterface interface {
GetTopNodeOnlineState() []NodeOnLineInfo
}