hydra

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hydra

type Hydra struct {
	Sybils          []*sybil.Sybil
	SharedDatastore datastore.Datastore
	// contains filtered or unexported fields
}

Hydra is a container for heads (sybils) and their shared belly bits.

func NewHydra

func NewHydra(ctx context.Context, options Options) (*Hydra, error)

NewHydra creates a new Hydra with the passed options.

func (*Hydra) GetUniquePeersCount

func (hy *Hydra) GetUniquePeersCount() uint64

GetUniquePeersCount retrieves the current total for unique peers

type Options

type Options struct {
	DatastorePath string
	GetPort       func() int
	NSybils       int
	BucketSize    int
	BsCon         int
	Relay         bool
	Stagger       time.Duration
	MetricsPeriod time.Duration
}

Options are configuration for a new hydra

type PeriodicMetrics

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

PeriodicMetrics periodically collects and records statistics with prometheus.

func NewPeriodicMetrics

func NewPeriodicMetrics(ctx context.Context, hy *Hydra, period time.Duration) *PeriodicMetrics

NewPeriodicMetrics creates a new PeriodicMetrics that immeidately begins to periodically collect and record statistics with prometheus.

Jump to

Keyboard shortcuts

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