config

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Workspace   string
	ListenAddrs ma.Multiaddr
	ConnManager connmgr.ConnManager
	BootPeers   []string
}

Config describes a set of settings for a libp2p node

This is *not* a stable interface. Use the options defined in the root package.

func (*Config) Apply

func (cfg *Config) Apply(opts ...Option) error

Apply applies the given options to the config, returning the first error encountered (if any).

func (*Config) NewNode

func (cfg *Config) NewNode(privatekeyPath string) (core.P2P, error)

NewNode constructs a new libp2p Host from the Config.

This function consumes the config. Do not reuse it (really!).

type Option

type Option func(cfg *Config) error

Option is a libp2p config option that can be given to the libp2p constructor (`libp2p.New`).

Jump to

Keyboard shortcuts

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