Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrAlreadySynced is reported when syncer is synced. ErrAlreadySynced = fmt.Errorf("already synced") // ErrNotSynced is reported when syncer is not synced yet. ErrNotSynced = fmt.Errorf("not synced yet") // ErrGenesisBlockReached is reported when genesis block reached. ErrGenesisBlockReached = fmt.Errorf("genesis block reached") // ErrInvalidBlockOrder is reported when SyncBlocks receives unordered // blocks. ErrInvalidBlockOrder = fmt.Errorf("invalid block order") // ErrInvalidSyncingHeight raised when the blocks to sync is not following // the compaction chain tip in database. ErrInvalidSyncingHeight = fmt.Errorf("invalid syncing height") )
Functions ¶
This section is empty.
Types ¶
type Consensus ¶
type Consensus struct {
// contains filtered or unexported fields
}
Consensus is for syncing consensus module.
func NewConsensus ¶
func NewConsensus( initHeight uint64, dMoment time.Time, app core.Application, gov core.Governance, db db.Database, network core.Network, prv crypto.PrivateKey, logger common.Logger) *Consensus
NewConsensus creates an instance for Consensus (syncer consensus).
func (*Consensus) GetSyncedConsensus ¶
GetSyncedConsensus returns the core.Consensus instance after synced.
func (*Consensus) SyncBlocks ¶
SyncBlocks syncs blocks from compaction chain, latest is true if the caller regards the blocks are the latest ones. Notice that latest can be true for many times. NOTICE: parameter "blocks" should be consecutive in compaction height. NOTICE: this method is not expected to be called concurrently.
type WatchCat ¶
type WatchCat struct {
// contains filtered or unexported fields
}
WatchCat is reponsible for signaling if syncer object should be terminated.
func NewWatchCat ¶
func NewWatchCat( recovery core.Recovery, configReader configReader, polling time.Duration, timeout time.Duration, logger common.Logger) *WatchCat
NewWatchCat creats a new WatchCat 🐱 object.
func (*WatchCat) LastPosition ¶
LastPosition returns the last position for recovery.
Click to show internal directories.
Click to hide internal directories.