updater

package
v0.0.0-...-1bfa4a9 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

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

An Updater is a task responsible for querying the darknodes periodically to know which darknodes are in the network. It does this by requesting the peers of a random subset of the already known darknodes and adding any new darknodes to a store. This store is shared by the `Dispatcher`, which needs to know about the darknodes in the network.

func New

func New(logger logrus.FieldLogger, multiStore store.MultiAddrStore, pollRate, timeout time.Duration) Updater

New constructs a new `Updater`. If the given store of multi addresses is empty, then the constructed `Updater` will be useless since it will not know any darknodes to query. Therefore the given store must contain some number of bootstrap addresses.

func (*Updater) Run

func (updater *Updater) Run(ctx context.Context)

Run starts the `Updater` making requests to the darknodes and updating its store. This function is blocking.

Jump to

Keyboard shortcuts

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