lightnode

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLightNodeLimit = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

func NewContainer

func NewContainer(base boson.Address) *Container

func (*Container) Connected

func (c *Container) Connected(ctx context.Context, peer p2p.Peer)

func (*Container) Count

func (c *Container) Count() int

func (*Container) Disconnected

func (c *Container) Disconnected(peer p2p.Peer)

func (*Container) EachPeer

func (c *Container) EachPeer(pf model.EachPeerFunc) error

func (*Container) Metrics

func (c *Container) Metrics() []prometheus.Collector

Metrics returns set of prometheus collectors.

func (*Container) PeerInfo

func (c *Container) PeerInfo() model.BinInfo

func (*Container) RandomPeer

func (c *Container) RandomPeer(not boson.Address) (boson.Address, error)

type LightNodes

type LightNodes interface {
	Connected(context.Context, p2p.Peer)
	Disconnected(p2p.Peer)
	Count() int
	RandomPeer(boson.Address) (boson.Address, error)
	EachPeer(pf model.EachPeerFunc) error
}

Jump to

Keyboard shortcuts

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