Documentation ¶
Index ¶
- Constants
- func CheckConfirm(confirm *payload.Confirm, minSignCount int) error
- func CheckProposal(proposal *payload.DPOSProposal) error
- func CheckVote(vote *payload.DPOSProposalVote) error
- func Debug(a ...interface{})
- func Debugf(format string, a ...interface{})
- func Error(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Fatal(a ...interface{})
- func Fatalf(format string, a ...interface{})
- func GetBridgeAccount(keystorePath string, password []byte) (crypto.Keypair, error)
- func GetDposAccount(keystorePath string, password []byte) (daccount.Account, error)
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func InitLog(level uint8, maxPerLogSizeMb, maxLogsSizeMb int64, path string)
- func StartProposal(ac account.Account, blockHash common.Uint256, viewOffset uint32) (*payload.DPOSProposal, error)
- func StartVote(ProposalHash *common.Uint256, isAcceipt bool, ac account.Account) (*payload.DPOSProposalVote, error)
- func Warn(a ...interface{})
- func Warnf(format string, a ...interface{})
- type BlockPool
- func (bm *BlockPool) AddBadBlock(block DBlock) error
- func (bm *BlockPool) AddToBlockMap(block DBlock)
- func (bm *BlockPool) AddToConfirmMap(confirm *payload.Confirm)
- func (bm *BlockPool) AppendConfirm(confirm *payload.Confirm) error
- func (bm *BlockPool) AppendDposBlock(dposBlock DBlock) error
- func (bm *BlockPool) AppendFutureBlock(dposBlock DBlock) error
- func (bm *BlockPool) CleanFinalConfirmedBlock(height uint64)
- func (bm *BlockPool) ConfirmBlock(hash common.Uint256) error
- func (bm *BlockPool) GetBlock(hash common.Uint256) (DBlock, bool)
- func (bm *BlockPool) GetConfirm(hash common.Uint256) (*payload.Confirm, bool)
- func (bm *BlockPool) GetConfirmByHeight(height uint64) (*payload.Confirm, bool)
- func (bm *BlockPool) HandleParentBlock(parent DBlock) bool
- func (bm *BlockPool) HasBlock(hash common.Uint256) bool
- func (bm *BlockPool) HashConfirmed(number uint64) bool
- func (bm *BlockPool) IsBadBlockProposal(proposal *payload.DPOSProposal) bool
- func (bm *BlockPool) IsFutureBlock(hash common.Uint256) bool
- func (bm *BlockPool) RemoveConfirm(hash common.Uint256)
- type Config
- type ConfirmInfo
- type ConsensusView
- func (v *ConsensusView) ChangeCurrentProducers(changeHeight uint64, spvHeight uint64)
- func (v *ConsensusView) ChangeView(now time.Time, force bool, parentTime uint64)
- func (v *ConsensusView) DumpInfo()
- func (v *ConsensusView) GetCRMajorityCount() int
- func (v *ConsensusView) GetChangeViewTime() time.Time
- func (v *ConsensusView) GetDutyIndex() uint32
- func (v *ConsensusView) GetMajorityCount() int
- func (v *ConsensusView) GetMajorityCountByTotalSigners(totalSigner int) int
- func (v *ConsensusView) GetNextNeedConnectArbiters() []peer.PID
- func (v *ConsensusView) GetProducers() [][]byte
- func (v *ConsensusView) GetSpvHeight() uint64
- func (v *ConsensusView) GetTotalArbiterCount() int
- func (v *ConsensusView) GetTotalProducersCount() int
- func (v *ConsensusView) GetViewInterval() time.Duration
- func (v *ConsensusView) GetViewOffset() uint32
- func (v *ConsensusView) GetViewStartTime() time.Time
- func (v *ConsensusView) HasArbitersMinorityCount(count int) bool
- func (v *ConsensusView) HasProducerMajorityCount(count int) bool
- func (v *ConsensusView) IsCurrentProducers(curProducers [][]byte) bool
- func (v *ConsensusView) IsMajorityAgree(count int) bool
- func (v *ConsensusView) IsMajorityRejected(count int) bool
- func (v *ConsensusView) IsOnduty() bool
- func (v *ConsensusView) IsProducers(account []byte) bool
- func (v *ConsensusView) IsReady() bool
- func (v *ConsensusView) IsRunning() bool
- func (v *ConsensusView) IsSameProducers(curProducers [][]byte) bool
- func (v *ConsensusView) ProducerIndex(signer []byte) int
- func (v *ConsensusView) ProducerIsOnDuty(account []byte) bool
- func (v *ConsensusView) ResetView(parentTime uint64)
- func (v *ConsensusView) SetChangViewTime(parentTime uint64)
- func (v *ConsensusView) SetReady()
- func (v *ConsensusView) SetRunning()
- func (v *ConsensusView) SetWorkingHeight(workingHeight uint64)
- func (v *ConsensusView) TryChangeView(now time.Time)
- func (v *ConsensusView) UpdateDutyIndex(height uint64)
- func (v *ConsensusView) UpdateNextProducers(producers []peer.PID, totalCount int)
- func (v *ConsensusView) UpdateProducers(producers [][]byte, totalCount int, spvHeight uint64)
- type DBlock
- type DPOSNetwork
- type Dispatcher
- func (d *Dispatcher) AcceptProposal(proposal *payload.DPOSProposal, ac account.Account) *msg.Vote
- func (d *Dispatcher) AddPendingVote(v *payload.DPOSProposalVote)
- func (d *Dispatcher) CleanProposals(changeView bool)
- func (d *Dispatcher) FinishedProposal(height uint64, sealHash common.Uint256, headerTime uint64)
- func (d *Dispatcher) GetConsensusView() *ConsensusView
- func (d *Dispatcher) GetCurrentNeedConnectArbiters() []peer.PID
- func (d *Dispatcher) GetFinishedBlockSealHash() common.Uint256
- func (d *Dispatcher) GetFinishedHeight() uint64
- func (d *Dispatcher) GetFinishedProposal() common.Uint256
- func (d *Dispatcher) GetNextNeedConnectArbiters() []peer.PID
- func (d *Dispatcher) GetNowTime() time.Time
- func (d *Dispatcher) GetProcessingProposal() *payload.DPOSProposal
- func (d *Dispatcher) GetProposalProcessFinished() bool
- func (d *Dispatcher) GetResetViewReqCount() int
- func (d *Dispatcher) HelpToRecoverAbnormal(id peer.PID, height uint64, currentHeight uint64) *dmsg.ConsensusStatus
- func (d *Dispatcher) IsProducer(account []byte) bool
- func (d *Dispatcher) OnChangeView()
- func (d *Dispatcher) OnResponseResetViewReceived(msg *msg.ResetView) error
- func (d *Dispatcher) ProcessProposal(id peer.PID, proposal *payload.DPOSProposal) (err error, isSendReject bool, handled bool)
- func (d *Dispatcher) ProcessVote(vote *payload.DPOSProposalVote) (succeed bool, finished bool, err error)
- func (d *Dispatcher) ProducerIsOnDuty() bool
- func (d *Dispatcher) RecordViewRequest(sponsor []byte)
- func (d *Dispatcher) RecoverAbnormal(status *dmsg.ConsensusStatus, medianTime int64)
- func (d *Dispatcher) RecoverFromConsensusStatus(status *dmsg.ConsensusStatus) error
- func (d *Dispatcher) RejectProposal(proposal *payload.DPOSProposal, ac account.Account) *msg.Vote
- func (d *Dispatcher) ResetAcceptVotes()
- func (d *Dispatcher) ResetConsensus(height uint64)
- func (d *Dispatcher) ResetView(parentTime uint64)
- func (d *Dispatcher) ResetViewRequestIsContain(sponsor []byte) bool
- func (d *Dispatcher) SetProposalProcessFinished()
- func (d *Dispatcher) UpdatePrecociousProposals() *payload.DPOSProposal
- type ElaMsg
- type ElaMsgType
- type IPeer
- type MsgEvent
- type Network
- func (n *Network) AddDirectLinkAddr(pid peer.PID, addr string)
- func (n *Network) BroadcastMessage(msg elap2p.Message)
- func (n *Network) DumpPeersInfo() []*p2p.PeerInfo
- func (n *Network) GetActivePeers() []p2p.Peer
- func (n *Network) PostChangeViewTask()
- func (n *Network) PostRecoverTask()
- func (n *Network) SendMessageToPeer(id peer.PID, msg elap2p.Message) error
- func (n *Network) Start()
- func (n *Network) Stop() error
- func (n *Network) UpdatePeers(currentPeers []peer.PID, nextPeers []peer.PID)
- type NetworkConfig
- type NetworkEventListener
- type Producers
- func (p *Producers) ChangeCurrentProducers(changeHeight uint64, spvHeight uint64)
- func (p *Producers) GetCRMajorityCount() int
- func (p *Producers) GetMajorityCount() int
- func (p *Producers) GetMajorityCountByTotalSigners(totalSigner int) int
- func (p *Producers) GetNeedConnectArbiters() []peer.PID
- func (p *Producers) GetNextNeedConnectArbiters() []peer.PID
- func (p *Producers) GetNextOnDutyProducer(offset uint32) []byte
- func (p *Producers) GetProducers() [][]byte
- func (p *Producers) GetProducersCount() int
- func (p *Producers) HasArbitersMinorityCount(num int) bool
- func (p *Producers) HasProducerMajorityCount(num int) bool
- func (p *Producers) IsMajorityAgree(count int) bool
- func (p *Producers) IsMajorityRejected(count int) bool
- func (p *Producers) IsProducers(signer []byte) bool
- func (p *Producers) ProducerIndex(signer []byte) int
- func (p *Producers) SetWorkingHeight(changeHeight uint64)
- func (p *Producers) UpdateDutyIndex(height uint64) uint32
- func (p *Producers) UpdateNextProducers(producers []peer.PID, totalCount int) error
- func (p *Producers) UpdateProducers(producers [][]byte, totalCount int, spvHeight uint64) error
- type Routes
- func (r *Routes) AnnounceAddr()
- func (r *Routes) DonePeer(peer IPeer)
- func (r *Routes) ElaMsg(msgEvent *MsgEvent)
- func (r *Routes) NewPeer(peer IPeer)
- func (r *Routes) OnGetData(p IPeer, m *msg.GetData)
- func (r *Routes) PeersChanged(peers []peer.PID)
- func (r *Routes) QueueInv(p IPeer, m *msg.Inv)
- func (r *Routes) Start()
- func (r *Routes) Stop()
- type StatusSyncEventListener
- type ViewListener
Constants ¶
View Source
const ( ConsensusReady = iota ConsensusRunning )
View Source
const ( ETNewPeer events.EventType = 1000 ETDonePeer events.EventType = 1001 ETStopRoutes events.EventType = 1002 ETElaMsg events.EventType = 1003 ETAnnounceAddr events.EventType = 1004 ETNextProducers events.EventType = 1005 ETOnSPVHeight events.EventType = 1006 ETSmallCroTx events.EventType = 1007 ETFailedWithdrawTx events.EventType = 1008 ETUpdateProducers events.EventType = 1009 ETOnDutyEvent events.EventType = 1010 )
Constants for the type of a notification message.
Variables ¶
This section is empty.
Functions ¶
func CheckProposal ¶
func CheckProposal(proposal *payload.DPOSProposal) error
func CheckVote ¶
func CheckVote(vote *payload.DPOSProposalVote) error
func GetBridgeAccount ¶ added in v0.2.1
func GetDposAccount ¶
func StartProposal ¶
Types ¶
type BlockPool ¶
type BlockPool struct { sync.RWMutex VerifyConfirm func(confirm *payload.Confirm, elaHeight uint64) error VerifyBlock func(block DBlock) error SealHash func(block DBlock) (common.Uint256, error) // contains filtered or unexported fields }
func NewBlockPool ¶
func (*BlockPool) AddBadBlock ¶
func (*BlockPool) AddToBlockMap ¶
func (*BlockPool) AddToConfirmMap ¶
func (*BlockPool) AppendConfirm ¶
func (*BlockPool) AppendDposBlock ¶
func (*BlockPool) AppendFutureBlock ¶
func (*BlockPool) CleanFinalConfirmedBlock ¶
func (*BlockPool) GetConfirm ¶
func (*BlockPool) GetConfirmByHeight ¶
func (*BlockPool) HandleParentBlock ¶
func (*BlockPool) HashConfirmed ¶
func (*BlockPool) IsBadBlockProposal ¶
func (bm *BlockPool) IsBadBlockProposal(proposal *payload.DPOSProposal) bool
func (*BlockPool) RemoveConfirm ¶
type Config ¶
type Config struct { // The PID of this peer if it is an producer. PID []byte // The network address of this arbiter. Addr string // TimeSource is the median time source of the P2P network. TimeSource dtime.MedianTimeSource // Sign the addr message of this arbiter. Sign func(data []byte) (signature []byte) // IsCurrent returns whether BlockChain synced to best height. IsCurrent func() bool // RelayAddr relays the addresses inventory to the P2P network. RelayAddr func(iv *msg.InvVect, data interface{}) // OnCipherAddr will be invoked when an address cipher received. OnCipherAddr func(pid peer.PID, cipher []byte) }
Config defines the parameters to create a Route instance.
type ConfirmInfo ¶
type ConsensusView ¶
type ConsensusView struct {
// contains filtered or unexported fields
}
func NewConsensusView ¶
func NewConsensusView(tolerance time.Duration, account []byte, producers *Producers, viewListener ViewListener) *ConsensusView
func (*ConsensusView) ChangeCurrentProducers ¶
func (v *ConsensusView) ChangeCurrentProducers(changeHeight uint64, spvHeight uint64)
func (*ConsensusView) ChangeView ¶
func (v *ConsensusView) ChangeView(now time.Time, force bool, parentTime uint64)
func (*ConsensusView) DumpInfo ¶
func (v *ConsensusView) DumpInfo()
func (*ConsensusView) GetCRMajorityCount ¶
func (v *ConsensusView) GetCRMajorityCount() int
func (*ConsensusView) GetChangeViewTime ¶
func (v *ConsensusView) GetChangeViewTime() time.Time
func (*ConsensusView) GetDutyIndex ¶
func (v *ConsensusView) GetDutyIndex() uint32
func (*ConsensusView) GetMajorityCount ¶
func (v *ConsensusView) GetMajorityCount() int
func (*ConsensusView) GetMajorityCountByTotalSigners ¶
func (v *ConsensusView) GetMajorityCountByTotalSigners(totalSigner int) int
func (*ConsensusView) GetNextNeedConnectArbiters ¶ added in v0.2.1
func (v *ConsensusView) GetNextNeedConnectArbiters() []peer.PID
func (*ConsensusView) GetProducers ¶
func (v *ConsensusView) GetProducers() [][]byte
func (*ConsensusView) GetSpvHeight ¶
func (v *ConsensusView) GetSpvHeight() uint64
func (*ConsensusView) GetTotalArbiterCount ¶ added in v0.2.1
func (v *ConsensusView) GetTotalArbiterCount() int
func (*ConsensusView) GetTotalProducersCount ¶ added in v0.2.0
func (v *ConsensusView) GetTotalProducersCount() int
func (*ConsensusView) GetViewInterval ¶
func (v *ConsensusView) GetViewInterval() time.Duration
func (*ConsensusView) GetViewOffset ¶
func (v *ConsensusView) GetViewOffset() uint32
func (*ConsensusView) GetViewStartTime ¶
func (v *ConsensusView) GetViewStartTime() time.Time
func (*ConsensusView) HasArbitersMinorityCount ¶
func (v *ConsensusView) HasArbitersMinorityCount(count int) bool
func (*ConsensusView) HasProducerMajorityCount ¶
func (v *ConsensusView) HasProducerMajorityCount(count int) bool
func (*ConsensusView) IsCurrentProducers ¶
func (v *ConsensusView) IsCurrentProducers(curProducers [][]byte) bool
func (*ConsensusView) IsMajorityAgree ¶
func (v *ConsensusView) IsMajorityAgree(count int) bool
func (*ConsensusView) IsMajorityRejected ¶
func (v *ConsensusView) IsMajorityRejected(count int) bool
func (*ConsensusView) IsOnduty ¶
func (v *ConsensusView) IsOnduty() bool
func (*ConsensusView) IsProducers ¶
func (v *ConsensusView) IsProducers(account []byte) bool
func (*ConsensusView) IsReady ¶
func (v *ConsensusView) IsReady() bool
func (*ConsensusView) IsRunning ¶
func (v *ConsensusView) IsRunning() bool
func (*ConsensusView) IsSameProducers ¶
func (v *ConsensusView) IsSameProducers(curProducers [][]byte) bool
func (*ConsensusView) ProducerIndex ¶ added in v0.2.1
func (v *ConsensusView) ProducerIndex(signer []byte) int
func (*ConsensusView) ProducerIsOnDuty ¶
func (v *ConsensusView) ProducerIsOnDuty(account []byte) bool
func (*ConsensusView) ResetView ¶
func (v *ConsensusView) ResetView(parentTime uint64)
func (*ConsensusView) SetChangViewTime ¶
func (v *ConsensusView) SetChangViewTime(parentTime uint64)
func (*ConsensusView) SetReady ¶
func (v *ConsensusView) SetReady()
func (*ConsensusView) SetRunning ¶
func (v *ConsensusView) SetRunning()
func (*ConsensusView) SetWorkingHeight ¶
func (v *ConsensusView) SetWorkingHeight(workingHeight uint64)
func (*ConsensusView) TryChangeView ¶
func (v *ConsensusView) TryChangeView(now time.Time)
func (*ConsensusView) UpdateDutyIndex ¶
func (v *ConsensusView) UpdateDutyIndex(height uint64)
func (*ConsensusView) UpdateNextProducers ¶
func (v *ConsensusView) UpdateNextProducers(producers []peer.PID, totalCount int)
func (*ConsensusView) UpdateProducers ¶
func (v *ConsensusView) UpdateProducers(producers [][]byte, totalCount int, spvHeight uint64)
type DPOSNetwork ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(producers [][]byte, onConfirm func(confirm *payload.Confirm) error, unConfirm func(confirm *payload.Confirm) error, tolerance time.Duration, publicKey []byte, medianTime dtime.MedianTimeSource, viewListener ViewListener, dposStartHeight uint64) *Dispatcher
func (*Dispatcher) AcceptProposal ¶
func (d *Dispatcher) AcceptProposal(proposal *payload.DPOSProposal, ac account.Account) *msg.Vote
func (*Dispatcher) AddPendingVote ¶
func (d *Dispatcher) AddPendingVote(v *payload.DPOSProposalVote)
func (*Dispatcher) CleanProposals ¶
func (d *Dispatcher) CleanProposals(changeView bool)
func (*Dispatcher) FinishedProposal ¶
func (d *Dispatcher) FinishedProposal(height uint64, sealHash common.Uint256, headerTime uint64)
func (*Dispatcher) GetConsensusView ¶
func (d *Dispatcher) GetConsensusView() *ConsensusView
func (*Dispatcher) GetCurrentNeedConnectArbiters ¶ added in v0.2.1
func (d *Dispatcher) GetCurrentNeedConnectArbiters() []peer.PID
func (*Dispatcher) GetFinishedBlockSealHash ¶
func (d *Dispatcher) GetFinishedBlockSealHash() common.Uint256
func (*Dispatcher) GetFinishedHeight ¶
func (d *Dispatcher) GetFinishedHeight() uint64
func (*Dispatcher) GetFinishedProposal ¶
func (d *Dispatcher) GetFinishedProposal() common.Uint256
func (*Dispatcher) GetNextNeedConnectArbiters ¶ added in v0.2.1
func (d *Dispatcher) GetNextNeedConnectArbiters() []peer.PID
func (*Dispatcher) GetNowTime ¶
func (d *Dispatcher) GetNowTime() time.Time
func (*Dispatcher) GetProcessingProposal ¶
func (d *Dispatcher) GetProcessingProposal() *payload.DPOSProposal
func (*Dispatcher) GetProposalProcessFinished ¶
func (d *Dispatcher) GetProposalProcessFinished() bool
func (*Dispatcher) GetResetViewReqCount ¶ added in v0.2.1
func (d *Dispatcher) GetResetViewReqCount() int
func (*Dispatcher) HelpToRecoverAbnormal ¶
func (d *Dispatcher) HelpToRecoverAbnormal(id peer.PID, height uint64, currentHeight uint64) *dmsg.ConsensusStatus
func (*Dispatcher) IsProducer ¶
func (d *Dispatcher) IsProducer(account []byte) bool
func (*Dispatcher) OnChangeView ¶
func (d *Dispatcher) OnChangeView()
func (*Dispatcher) OnResponseResetViewReceived ¶ added in v0.2.1
func (d *Dispatcher) OnResponseResetViewReceived(msg *msg.ResetView) error
func (*Dispatcher) ProcessProposal ¶
func (d *Dispatcher) ProcessProposal(id peer.PID, proposal *payload.DPOSProposal) (err error, isSendReject bool, handled bool)
func (*Dispatcher) ProcessVote ¶
func (d *Dispatcher) ProcessVote(vote *payload.DPOSProposalVote) (succeed bool, finished bool, err error)
func (*Dispatcher) ProducerIsOnDuty ¶
func (d *Dispatcher) ProducerIsOnDuty() bool
func (*Dispatcher) RecordViewRequest ¶ added in v0.2.1
func (d *Dispatcher) RecordViewRequest(sponsor []byte)
func (*Dispatcher) RecoverAbnormal ¶
func (d *Dispatcher) RecoverAbnormal(status *dmsg.ConsensusStatus, medianTime int64)
func (*Dispatcher) RecoverFromConsensusStatus ¶
func (d *Dispatcher) RecoverFromConsensusStatus(status *dmsg.ConsensusStatus) error
func (*Dispatcher) RejectProposal ¶
func (d *Dispatcher) RejectProposal(proposal *payload.DPOSProposal, ac account.Account) *msg.Vote
func (*Dispatcher) ResetAcceptVotes ¶
func (d *Dispatcher) ResetAcceptVotes()
func (*Dispatcher) ResetConsensus ¶ added in v0.2.1
func (d *Dispatcher) ResetConsensus(height uint64)
func (*Dispatcher) ResetView ¶
func (d *Dispatcher) ResetView(parentTime uint64)
func (*Dispatcher) ResetViewRequestIsContain ¶ added in v0.2.1
func (d *Dispatcher) ResetViewRequestIsContain(sponsor []byte) bool
func (*Dispatcher) SetProposalProcessFinished ¶
func (d *Dispatcher) SetProposalProcessFinished()
func (*Dispatcher) UpdatePrecociousProposals ¶
func (d *Dispatcher) UpdatePrecociousProposals() *payload.DPOSProposal
type ElaMsg ¶
type ElaMsg struct { Type ElaMsgType Msg []byte }
type Network ¶
type Network struct { GetCurrentHeight func(pid peer.PID) uint64 // contains filtered or unexported fields }
func NewNetwork ¶
func NewNetwork(cfg *NetworkConfig) (*Network, error)
func (*Network) BroadcastMessage ¶
func (*Network) DumpPeersInfo ¶
DumpPeersInfo returns an array consisting of all peers state in connect list.
This function is safe for concurrent access and is part of the IServer interface implementation.
func (*Network) GetActivePeers ¶
func (*Network) PostChangeViewTask ¶
func (n *Network) PostChangeViewTask()
func (*Network) PostRecoverTask ¶
func (n *Network) PostRecoverTask()
func (*Network) SendMessageToPeer ¶
type NetworkConfig ¶
type NetworkConfig struct { IPAddress string Magic uint32 DefaultPort uint16 MaxNodePerHost uint32 DPoSV2StartHeight uint32 Account account.Account MedianTime dtime.MedianTimeSource Listener NetworkEventListener DataPath string NodeVersion string GetCurrentHeight func(pid peer.PID) uint64 ProposalDispatcher *Dispatcher PublicKey []byte AnnounceAddr func() }
type NetworkEventListener ¶
type NetworkEventListener interface { StatusSyncEventListener OnProposalReceived(id dpeer.PID, proposal *payload.DPOSProposal) OnVoteAccepted(id dpeer.PID, proposal *payload.DPOSProposalVote) OnVoteRejected(id dpeer.PID, proposal *payload.DPOSProposalVote) OnChangeView() OnBadNetwork() OnRecover() OnResponseResetViewReceived(msg *msg.ResetView) OnBlockReceived(id dpeer.PID, b *dmsg.BlockMsg, confirmed bool) OnConfirmReceived(id dpeer.PID, c *payload.Confirm, height uint64) OnSmallCroTxReceived(id dpeer.PID, c *dmsg.SmallCroTx) OnFailedWithdrawTxReceived(id dpeer.PID, c *dmsg.FailedWithdrawTx) OnLayer2Msg(id dpeer.PID, c elap2p.Message) }
type Producers ¶
type Producers struct {
// contains filtered or unexported fields
}
func NewProducers ¶
func (*Producers) ChangeCurrentProducers ¶
func (*Producers) GetCRMajorityCount ¶
func (*Producers) GetMajorityCount ¶
func (*Producers) GetMajorityCountByTotalSigners ¶
func (*Producers) GetNeedConnectArbiters ¶
func (*Producers) GetNextNeedConnectArbiters ¶ added in v0.2.1
func (*Producers) GetNextOnDutyProducer ¶
func (*Producers) GetProducers ¶
func (*Producers) GetProducersCount ¶
func (*Producers) HasArbitersMinorityCount ¶
func (*Producers) HasProducerMajorityCount ¶
func (*Producers) IsMajorityAgree ¶
func (*Producers) IsMajorityRejected ¶
func (*Producers) IsProducers ¶
func (*Producers) ProducerIndex ¶ added in v0.2.1
func (*Producers) SetWorkingHeight ¶
func (*Producers) UpdateDutyIndex ¶
func (*Producers) UpdateNextProducers ¶
type Routes ¶
type Routes struct {
// contains filtered or unexported fields
}
func (*Routes) AnnounceAddr ¶
func (r *Routes) AnnounceAddr()
AnnounceAddr schedules an local address announce to the P2P network, it used to re-announce the local address when DPoS network go bad.
func (*Routes) PeersChanged ¶
type StatusSyncEventListener ¶
type StatusSyncEventListener interface { OnPing(id dpeer.PID, height uint32) OnPong(id dpeer.PID, height uint32) OnBlock(id dpeer.PID, block *dmsg.BlockMsg) OnInv(id dpeer.PID, blockHash common.Uint256) OnGetBlock(id dpeer.PID, blockHash common.Uint256) OnGetBlocks(id dpeer.PID, startBlockHeight, endBlockHeight uint32) OnResponseBlocks(id dpeer.PID, blockConfirms []*dmsg.BlockMsg) OnRequestConsensus(id dpeer.PID, height uint64) OnResponseConsensus(id dpeer.PID, status *dmsg.ConsensusStatus) OnRequestProposal(id dpeer.PID, hash common.Uint256) OnIllegalProposalReceived(id dpeer.PID, proposals *payload.DPOSIllegalProposals) OnIllegalVotesReceived(id dpeer.PID, votes *payload.DPOSIllegalVotes) }
type ViewListener ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.