Versions in this module Expand all Collapse all v1 v1.0.1 Dec 19, 2019 Changes in this version + var MaxBlockFetch = 128 + var MaxBodyFetch = 128 + var MaxForkAncestry = 3 * params.EpochDuration + var MaxHashFetch = 512 + var MaxHeaderFetch = 192 + var MaxReceiptFetch = 256 + var MaxSkeletonSize = 128 + var MaxStateFetch = 384 + type BlockChain interface + Config func() *params.ChainConfig + CurrentBlock func() *types.Block + CurrentFastBlock func() *types.Block + FastSyncCommitHead func(common.Hash) error + GetBlockByHash func(common.Hash) *types.Block + HasBlock func(common.Hash, uint64) bool + InsertChain func(types.Blocks) (int, error) + InsertReceiptChain func(types.Blocks, []types.Receipts) (int, error) + type DoneEvent struct + type Downloader struct + func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockChain, ...) *Downloader + func (d *Downloader) Cancel() + func (d *Downloader) DeliverBodies(id string, transactions [][]*types.Transaction, uncles [][]*types.Header) (err error) + func (d *Downloader) DeliverHeaders(id string, headers []*types.Header) (err error) + func (d *Downloader) DeliverNodeData(id string, data [][]byte) (err error) + func (d *Downloader) DeliverReceipts(id string, receipts [][]*types.Receipt) (err error) + func (d *Downloader) GetPeers() *peerSet + func (d *Downloader) Progress() ethereum.SyncProgress + func (d *Downloader) RegisterLightPeer(id string, version int, peer LightPeer) error + func (d *Downloader) RegisterPeer(id string, version int, peer Peer) error + func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode SyncMode) error + func (d *Downloader) Synchronising() bool + func (d *Downloader) Terminate() + func (d *Downloader) UnregisterPeer(id string) error + type FailedEvent struct + Err error + type FakePeer struct + func NewFakePeer(id string, db ethdb.Database, hc *core.HeaderChain, dl *Downloader) *FakePeer + func (p *FakePeer) Head(string) (common.Hash, *big.Int) + func (p *FakePeer) RequestBodies(hashes []common.Hash, appId string) error + func (p *FakePeer) RequestHeadersByHash(hash common.Hash, amount int, skip int, reverse bool, appId string) error + func (p *FakePeer) RequestHeadersByNumber(number uint64, amount int, skip int, reverse bool, appId string) error + func (p *FakePeer) RequestNodeData(hashes []common.Hash, appId string) error + func (p *FakePeer) RequestReceipts(hashes []common.Hash, appId string) error + type LightChain interface + CurrentHeader func() *types.Header + GetHeaderByHash func(common.Hash) *types.Header + GetTd func(common.Hash, uint64) *big.Int + HasHeader func(common.Hash, uint64) bool + InsertHeaderChain func([]*types.Header, int) (int, error) + Rollback func([]common.Hash) + type LightPeer interface + Head func(string) (common.Hash, *big.Int) + RequestHeadersByHash func(common.Hash, int, int, bool, string) error + RequestHeadersByNumber func(uint64, int, int, bool, string) error + type Peer interface + RequestBodies func([]common.Hash, string) error + RequestNodeData func([]common.Hash, string) error + RequestReceipts func([]common.Hash, string) error + type PublicDownloaderAPI struct + func NewPublicDownloaderAPI(d *Downloader, m *event.TypeMux) *PublicDownloaderAPI + func (api *PublicDownloaderAPI) SubscribeSyncStatus(status chan interface{}) *SyncStatusSubscription + func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error) + type StartEvent struct + type SyncMode int + const FastSync + const FullSync + const LightSync + func (mode *SyncMode) UnmarshalText(text []byte) error + func (mode SyncMode) IsValid() bool + func (mode SyncMode) MarshalText() ([]byte, error) + func (mode SyncMode) String() string + type SyncStatusSubscription struct + func (s *SyncStatusSubscription) Unsubscribe() + type SyncingResult struct + Status ethereum.SyncProgress + Syncing bool