Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxChunkPerSyncRequest = 10 ConcurrentSyncChunkDataCount = 10 GetChunkDataTimeout = 10 // 10s. )
Contants
Variables ¶
View Source
var ( ErrInvalidChainSyncMessageData = errors.New("invalid ChainSync message data") ErrInvalidChainGetChunkMessageData = errors.New("invalid ChainGetChunk message data") )
Errors
View Source
var ( ErrInvalidChainChunksMessageData = errors.New("invalid ChainChunks message data") ErrWrongChainChunksMessageData = errors.New("wrong ChainChunks message data") ErrInvalidChainChunkDataMessageData = errors.New("invalid ChainChunkData message data") ErrWrongChainChunkDataMessageData = errors.New("wrong ChainChunkData message data") ErrInvalidChunkHeaderSourcePeer = errors.New("invalid chunk headers source peer") )
Errors
View Source
var ( ErrTooSmallGapToSync = errors.New("the gap between syncpoint and current tail is smaller than a dynasty interval, ignore the sync task") ErrCannotFindBlockByHeight = errors.New("cannot find the block at given height") ErrCannotFindBlockByHash = errors.New("cannot find the block with the given hash") ErrWrongChunkHeaderRootHash = errors.New("wrong chunk header root hash") ErrWrongChunkDataRootHash = errors.New("wrong chunk data root hash") ErrWrongChunkDataSize = errors.New("wrong chunk data size") ErrInvalidBlockHashInChunk = errors.New("invalid block hash in chunk data") ErrWrongBlockHashInChunk = errors.New("wrong block hash in chunk data compared with chunk header") )
Error Types
Functions ¶
This section is empty.
Types ¶
type Chunk ¶ added in v1.0.0
type Chunk struct {
// contains filtered or unexported fields
}
Chunk packs some blocks
func NewChunk ¶ added in v1.0.0
func NewChunk(blockChain *core.BlockChain) *Chunk
NewChunk return a new chunk
type Service ¶ added in v1.0.0
type Service struct {
// contains filtered or unexported fields
}
Service manage sync tasks
func NewService ¶ added in v1.0.0
func NewService(blockChain *core.BlockChain, netService net.Service) *Service
NewService return new Service.
func (*Service) IsActiveSyncing ¶ added in v1.0.0
IsActiveSyncing return if there is active task now
func (*Service) StartActiveSync ¶ added in v1.0.0
StartActiveSync starts an active sync task
func (*Service) StopActiveSync ¶ added in v1.0.0
func (ss *Service) StopActiveSync()
StopActiveSync stops current sync task
func (*Service) WaitingForFinish ¶ added in v1.0.0
func (ss *Service) WaitingForFinish()
WaitingForFinish wait for finishing current sync task
Click to show internal directories.
Click to hide internal directories.