Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockByHeight ¶ added in v1.2.0
BlockByHeight returns the block of a given height
type BlockSync ¶
type BlockSync interface { lifecycle.StartStopper TargetHeight() uint64 ProcessSyncRequest(context.Context, uint64, uint64, func(context.Context, *block.Block) error) error ProcessBlock(context.Context, string, *block.Block) error SyncStatus() string }
BlockSync defines the interface of blocksyncer
func NewBlockSyncer ¶
func NewBlockSyncer( cfg config.BlockSync, tipHeightHandler TipHeight, blockByHeightHandler BlockByHeight, commitBlockHandler CommitBlock, requestBlocksHandler RequestBlocks, ) (BlockSync, error)
NewBlockSyncer returns a new block syncer instance
type CommitBlock ¶ added in v1.2.0
CommitBlock commits a block to blockchain
type RequestBlocks ¶ added in v1.2.0
RequestBlocks send a block request to peers
Click to show internal directories.
Click to hide internal directories.