host

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(w io.Writer)

SetLogger overrides the logger output for this package.

Types

type Host

type Host struct {
	// NodeURI can be used to set the enode:// connection string that
	// the pool should advertise to clients. Normally, the pool will
	// automatically deduce this string from the connection IP and nodeID, but
	// we can provide an override if there is a non-standard port or if the
	// node runs on a different IP from the vipnode agent.
	NodeURI string
	// contains filtered or unexported fields
}

Host represents a single vipnode host.

func New

func New(node ethnode.EthNode, payout string) *Host

func (*Host) Disconnect added in v0.2.5

func (h *Host) Disconnect(ctx context.Context, nodeID string) error

Disconnect a client from this host and remove from whitelist.

func (*Host) Start

func (h *Host) Start(p pool.Pool) error

Start registers the host on the given pool and starts sending peer updates every store.KeepaliveInterval. It returns after successfully registering with the pool.

func (*Host) Stop

func (h *Host) Stop()

Stop will terminate the update peers loop, which will cause Start to return.

func (*Host) Wait

func (h *Host) Wait() error

Wait blocks until the host is stopped. It returns any errors that occur during stopping.

func (*Host) Whitelist

func (h *Host) Whitelist(ctx context.Context, nodeID string) error

Whitelist a client for this host.

type HostService

type HostService interface {
	Whitelist(ctx context.Context, nodeID string) error
}

Jump to

Keyboard shortcuts

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