peerleecher

package
v0.0.1-rc Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpochDownloaderCallbacks

type EpochDownloaderCallbacks struct {
	OnlyNotConnected OnlyNotConnectedFn

	RequestChunks func(n dag.Metric, maxChunks uint32) error

	Suspend func() bool

	Done func() bool
}

type EpochDownloaderConfig

type EpochDownloaderConfig struct {
	RecheckInterval        time.Duration
	DefaultChunkSize       dag.Metric
	ParallelChunksDownload int
}

type OnlyNotConnectedFn

type OnlyNotConnectedFn func(ids hash.Events) hash.Events

OnlyNotConnectedFn returns only not connected events.

type PeerLeecher

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

PeerLeecher is responsible for accumulating pack announcements from various peers and scheduling them for retrieval.

func New

New creates a packs fetcher to retrieve events based on pack announcements. Works only with 1 peer.

func (*PeerLeecher) NotifyChunkReceived

func (d *PeerLeecher) NotifyChunkReceived(last hash.Event) error

NotifyPackInfo injects new pack infos from a peer

func (*PeerLeecher) Start

func (d *PeerLeecher) Start()

Start boots up the announcement based synchroniser, accepting and processing hash notifications and event fetches until termination requested.

func (*PeerLeecher) Stop

func (d *PeerLeecher) Stop()

Stop terminates the announcement based synchroniser, canceling all pending operations.

func (*PeerLeecher) Stopped

func (d *PeerLeecher) Stopped() bool

func (*PeerLeecher) Terminate

func (d *PeerLeecher) Terminate()

Jump to

Keyboard shortcuts

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