snap

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoneEvent

type DoneEvent struct {
	Latest *types.Header
}

type FailedEvent

type FailedEvent struct{ Err error }

type PublicDownloaderAPI

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

PublicDownloaderAPI provides an API which gives information about the current synchronisation status. It offers only methods that operates on data that can be available to anyone without security risks.

func NewPublicDownloaderAPI

func NewPublicDownloaderAPI(l *snapleecher.Leecher, m *event.TypeMux) *PublicDownloaderAPI

NewPublicDownloaderAPI create a new PublicDownloaderAPI. The API has an internal event loop that listens for events from the downloader through the global event mux. In case it receives one of these events it broadcasts it to all syncing subscriptions that are installed through the installSyncSubscription channel.

func (*PublicDownloaderAPI) SubscribeSyncStatus

func (api *PublicDownloaderAPI) SubscribeSyncStatus(status chan interface{}) *SyncStatusSubscription

SubscribeSyncStatus creates a subscription that will broadcast new synchronisation updates. The given channel must receive interface values, the result can either

func (*PublicDownloaderAPI) Syncing

func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error)

Syncing provides information when this nodes starts synchronising with the Ethereum network and when it's finished.

type StartEvent

type StartEvent struct{}

type SyncStatusSubscription

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

SyncStatusSubscription represents a syncing subscription.

func (*SyncStatusSubscription) Unsubscribe

func (s *SyncStatusSubscription) Unsubscribe()

Unsubscribe uninstalls the subscription from the DownloadAPI event loop. The status channel that was passed to subscribeSyncStatus isn't used anymore after this method returns.

type SyncingResult

type SyncingResult struct {
	Syncing bool                  `json:"syncing"`
	Status  ethereum.SyncProgress `json:"status"`
}

SyncingResult provides information about the current synchronisation status for this node.

Directories

Path Synopsis
snapstream

Jump to

Keyboard shortcuts

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