config

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DevnetProtocolPrefix  = "/devnet"
	TestnetProtocolPrefix = "/testnet"
	MainnetProtocolPrefix = "/mainnet"
)

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
	PrivatekeyPath string
	ProtocolPrefix string
	PublicIpv4     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