Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsensusInterface ¶
type ConsensusInterface interface { Type() string Version() int64 // 用于回滚或者重启时一些临时数据的恢复 InitCurrent(block *pb.InternalBlock) error Configure(xlog log.Logger, cfg *config.NodeConfig, consCfg map[string]interface{}, extParams map[string]interface{}) error // CompeteMaster 返回是否为矿工以及是否需要进行SyncBlock CompeteMaster(height int64) (bool, bool) CheckMinerMatch(header *pb.Header, in *pb.InternalBlock) (bool, error) // 开始挖矿前进行相应的处理 ProcessBeforeMiner(timestamp int64) (map[string]interface{}, bool) // 用于确认块后进行相应的处理 ProcessConfirmBlock(block *pb.InternalBlock) error // Get current core miner info GetCoreMiners() []*MinerInfo // Get consensus status GetStatus() *ConsensusStatus }
ConsensusInterface is the interface of consensus
type ConsensusStatus ¶
ConsensusStatus define the status of Consensus
type MinerInfo ¶
type MinerInfo struct { Address string // AmpChain address PeerInfo string // peer info(in most cases is the network address) }
MinerInfo defines the essential info of miner
type MinersChangedEvent ¶
MinersChangedEvent define the information of miners would be changed. this event would be fired when DPoS proposers initialized or next round proposers are selected.
Click to show internal directories.
Click to hide internal directories.