Documentation ¶
Index ¶
- Constants
- Variables
- func SyncStageString(v api.SyncStateStage) string
- func VerifyElectionPoStVRF(ctx context.Context, evrf []byte, rand []byte, worker, miner address.Address) error
- type BadBlockCache
- type SyncFunc
- type SyncManager
- type Syncer
- func (syncer *Syncer) ChainStore() *store.ChainStore
- func (syncer *Syncer) FetchTipSet(ctx context.Context, p peer.ID, tsk types.TipSetKey) (*store.FullTipSet, error)
- func (syncer *Syncer) IncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error)
- func (syncer *Syncer) InformNewBlock(from peer.ID, blk *types.FullBlock) bool
- func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) bool
- func (syncer *Syncer) LocalPeer() peer.ID
- func (syncer *Syncer) MarkBad(blk cid.Cid)
- func (syncer *Syncer) Start()
- func (syncer *Syncer) State() []SyncerState
- func (syncer *Syncer) Stop()
- func (syncer *Syncer) Sync(ctx context.Context, maybeHead *types.TipSet) error
- func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) error
- func (syncer *Syncer) ValidateMsgMeta(fblk *types.FullBlock) error
- func (syncer *Syncer) ValidateTipSet(ctx context.Context, fts *store.FullTipSet) error
- func (syncer *Syncer) VerifyElectionPoStProof(ctx context.Context, h *types.BlockHeader, baseTs *types.TipSet, ...) error
- type SyncerState
Constants ¶
View Source
const ( BSStateInit = 0 BSStateSelected = 1 BSStateScheduled = 2 BSStateComplete = 3 )
View Source
const BootstrapPeerThreshold = 2
Variables ¶
View Source
var ErrForkTooLong = fmt.Errorf("fork longer than threshold")
View Source
var ErrTemporal = errors.New("temporal error")
View Source
var LocalIncoming = "incoming"
Functions ¶
func SyncStageString ¶
func SyncStageString(v api.SyncStateStage) string
Types ¶
type BadBlockCache ¶
type BadBlockCache struct {
// contains filtered or unexported fields
}
func NewBadBlockCache ¶
func NewBadBlockCache() *BadBlockCache
func (*BadBlockCache) Add ¶
func (bts *BadBlockCache) Add(c cid.Cid)
func (*BadBlockCache) Has ¶
func (bts *BadBlockCache) Has(c cid.Cid) bool
type SyncManager ¶
type SyncManager struct {
// contains filtered or unexported fields
}
func NewSyncManager ¶
func NewSyncManager(sync SyncFunc) *SyncManager
func (*SyncManager) IsBootstrapped ¶
func (sm *SyncManager) IsBootstrapped() bool
func (*SyncManager) SetPeerHead ¶
func (*SyncManager) Start ¶
func (sm *SyncManager) Start()
func (*SyncManager) Stop ¶
func (sm *SyncManager) Stop()
type Syncer ¶
type Syncer struct { // The known Genesis tipset Genesis *types.TipSet // handle to the block sync service Bsync *blocksync.BlockSync // contains filtered or unexported fields }
func NewSyncer ¶
func NewSyncer(sm *stmgr.StateManager, bsync *blocksync.BlockSync, connmgr connmgr.ConnManager, self peer.ID) (*Syncer, error)
func (*Syncer) ChainStore ¶
func (syncer *Syncer) ChainStore() *store.ChainStore
func (*Syncer) FetchTipSet ¶
func (*Syncer) IncomingBlocks ¶
func (*Syncer) InformNewBlock ¶
func (*Syncer) InformNewHead ¶
InformNewHead informs the syncer about a new potential tipset This should be called when connecting to new peers, and additionally when receiving new blocks from the network
func (*Syncer) State ¶
func (syncer *Syncer) State() []SyncerState
func (*Syncer) ValidateBlock ¶
Should match up with 'Semantical Validation' in validation.md in the spec
func (*Syncer) ValidateTipSet ¶
func (*Syncer) VerifyElectionPoStProof ¶
type SyncerState ¶
type SyncerState struct { Target *types.TipSet Base *types.TipSet Stage api.SyncStateStage Height uint64 Message string Start time.Time End time.Time // contains filtered or unexported fields }
func (*SyncerState) Error ¶
func (ss *SyncerState) Error(err error)
func (*SyncerState) Init ¶
func (ss *SyncerState) Init(base, target *types.TipSet)
func (*SyncerState) SetHeight ¶
func (ss *SyncerState) SetHeight(h uint64)
func (*SyncerState) SetStage ¶
func (ss *SyncerState) SetStage(v api.SyncStateStage)
func (*SyncerState) Snapshot ¶
func (ss *SyncerState) Snapshot() SyncerState
Source Files ¶
Click to show internal directories.
Click to hide internal directories.