block_sync

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockSync

type BlockSync struct {
	// contains filtered or unexported fields
}

todo: requester and chunk change to sync pool

func NewBlockSync

func NewBlockSync(logger logrus.FieldLogger, fn func(height uint64) (*types.Block, error), network network.Network, cnf repo.Sync) (*BlockSync, error)

func (*BlockSync) Commit

func (bs *BlockSync) Commit() chan []*types.Block

func (*BlockSync) InitBlockSyncInfo

func (bs *BlockSync) InitBlockSyncInfo(peers []string, latestBlockHash string, quorum, curHeight, targetHeight uint64,
	quorumCheckpoint *consensus.SignedCheckpoint, epc ...*consensus.EpochChange)

func (*BlockSync) Start

func (bs *BlockSync) Start() error

func (*BlockSync) StartSync

func (bs *BlockSync) StartSync(peers []string, latestBlockHash string, quorum, curHeight, targetHeight uint64,
	quorumCheckpoint *consensus.SignedCheckpoint, epc ...*consensus.EpochChange) error

func (*BlockSync) Stop

func (bs *BlockSync) Stop()

func (*BlockSync) StopSync

func (bs *BlockSync) StopSync() error

type Sync

type Sync interface {
	Start() error
	Stop()
	Commit() chan []*types.Block
	StartSync(peers []string, curBlockHash string, quorum, curHeight, targetHeight uint64, quorumCheckpoint *consensus.SignedCheckpoint, epc ...*consensus.EpochChange) error
	StopSync() error
}

Directories

Path Synopsis
Package mock_block_sync is a generated GoMock package.
Package mock_block_sync is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL