config

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 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 {
	ListenPort         int
	ConnManager        connmgr.ConnManager
	BootPeers          []string
	Workspace          string
	ProtocolVersion    string
	DhtProtocolVersion string
	PrivatekeyPath     string
}

Config describes a set of settings for a libp2p node

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(ctx context.Context) (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