host

package
v0.2.4-0...-f8342f3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostCmd

type HostCmd struct {
	*base.Base

	GlobalPeerstores track.Peerstores
	CurrentPeerstore track.DynamicPeerstore

	GossipMetrics *metrics.GossipMetrics

	WithSetHost
	WithCloseHost
	base.PrivSettings
	base.WithEnrNode
}

func (*HostCmd) Cmd

func (c *HostCmd) Cmd(route string) (cmd interface{}, err error)

func (*HostCmd) Help

func (c *HostCmd) Help() string

func (*HostCmd) Routes

func (c *HostCmd) Routes() []string

type HostListenCmd

type HostListenCmd struct {
	*base.Base
	base.WithEnrNode

	IP net.IP `ask:"--ip" help:"If no IP is specified, network interfaces are checked for one."`

	TcpPort uint16 `ask:"--tcp" help:"If no tcp port is specified, it defaults to the ENR TCP port."`
}

func (*HostListenCmd) Default

func (c *HostListenCmd) Default()

func (*HostListenCmd) Help

func (c *HostListenCmd) Help() string

func (*HostListenCmd) Run

func (c *HostListenCmd) Run(ctx context.Context, args ...string) error

type HostNotifyCmd

type HostNotifyCmd struct {
	*base.Base
	*metrics.GossipMetrics
}

func (*HostNotifyCmd) Help

func (c *HostNotifyCmd) Help() string

func (*HostNotifyCmd) HelpLong

func (c *HostNotifyCmd) HelpLong() string

func (*HostNotifyCmd) Run

func (c *HostNotifyCmd) Run(ctx context.Context, args ...string) error

type HostStartCmd

type HostStartCmd struct {
	*base.Base
	base.PrivSettings
	WithSetHost

	GlobalPeerstores track.Peerstores
	CurrentPeerstore track.DynamicPeerstore

	PrivKey            flags.P2pPrivKeyFlag `ask:"--priv" help:"hex-encoded private key for libp2p host. Random if none is specified."`
	TransportsStrArr   []string             `ask:"--transport" help:"Transports to use. Options: tcp, ws"`
	MuxStrArr          []string             `ask:"--mux" help:"Multiplexers to use"`
	SecurityArr        []string             `ask:"--security" help:"Security to use. Multiple can be selected, order matters. Options: secio, noise, tls, none"`
	RelayEnabled       bool                 `ask:"--relay" help:"enable relayer functionality"`
	LoPeers            int                  `ask:"--lo-peers" help:"low-water for connection manager to trim peer count to"`
	HiPeers            int                  `ask:"--hi-peers" help:"high-water for connection manager to trim peer count from"`
	GracePeriod        time.Duration        `ask:"--peer-grace-period" help:"Time to grace a peer from being trimmed"`
	NatEnabled         bool                 `ask:"--nat" help:"enable nat address discovery (upnp/pmp)"`
	UserAgent          string               `ask:"--agent" help:"user agent string to use in libp2p identify protocol"`
	EnableIdentify     bool                 `ask:"--identify" help:"Enable the libp2p identify protocol"`
	IDFirst            bool                 `ask:"--identify-first" help:"Try and identify upon connecting with the host"`
	EnablePing         bool                 `ask:"--libp2p-ping" help:"Enable the libp2p ping background service"`
	NegotiationTimeout time.Duration        `ask:"--negotiation-timeout" help:"Time to allow for negotiation. Negative to disable."`
	SignedPeerRecord   bool                 `ask:"--signed-peer-records" help:"Use signed peer records"`
}

func (*HostStartCmd) Default

func (c *HostStartCmd) Default()

func (*HostStartCmd) Help

func (c *HostStartCmd) Help() string

func (*HostStartCmd) Run

func (c *HostStartCmd) Run(ctx context.Context, args ...string) error

type HostState

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

func (*HostState) CloseHost

func (s *HostState) CloseHost() error

func (*HostState) GetHostPriv

func (s *HostState) GetHostPriv() *crypto.Secp256k1PrivateKey

func (*HostState) Host

func (s *HostState) Host() (h host.Host, err error)

shortcut to check if there is a libp2p host available, and error-log if not available.

func (*HostState) SetHost

func (s *HostState) SetHost(h host.Host) error

type HostStopCmd

type HostStopCmd struct {
	*base.Base
	WithCloseHost
}

func (*HostStopCmd) Help

func (c *HostStopCmd) Help() string

func (*HostStopCmd) Run

func (c *HostStopCmd) Run(ctx context.Context, args ...string) error

type HostViewCmd

type HostViewCmd struct {
	*base.Base
	base.WithEnrNode
}

func (*HostViewCmd) Help

func (c *HostViewCmd) Help() string

func (*HostViewCmd) Run

func (c *HostViewCmd) Run(ctx context.Context, args ...string) error

type WithCloseHost

type WithCloseHost interface {
	CloseHost() error
}

type WithSetHost

type WithSetHost interface {
	SetHost(h host.Host) error
}

Jump to

Keyboard shortcuts

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