config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppConfigFilename         = "config.yaml"
	DhtPeerstoreDataDirectory = "peerstore"
	DefaultHTTPPort           = 9090
)
View Source
const (
	Version         = "v0.6.0"
	UserAgent       = UserAgentPrefix + Version
	UserAgentPrefix = "awl-bootstrap/"
)

Variables

This section is empty.

Functions

func CalcAppDataDir

func CalcAppDataDir() string

Types

type Config

type Config struct {
	sync.RWMutex
	P2pNode           P2pNode
	LoggerLevel       string
	HttpListenAddress string
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig() (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) DevMode

func (c *Config) DevMode() bool

func (*Config) GetBootstrapPeers

func (c *Config) GetBootstrapPeers() []peer.AddrInfo

func (*Config) GetListenAddresses

func (c *Config) GetListenAddresses() []multiaddr.Multiaddr

func (*Config) LogLevel

func (c *Config) LogLevel() zapcore.Level

func (*Config) Path

func (c *Config) Path() string

func (*Config) PeerstoreDir

func (c *Config) PeerstoreDir() string

func (*Config) PrivKey

func (c *Config) PrivKey() []byte

func (*Config) Save

func (c *Config) Save()

func (*Config) SetIdentity

func (c *Config) SetIdentity(key crypto.PrivKey, id peer.ID)

func (*Config) SetListenAddresses

func (c *Config) SetListenAddresses(multiaddrs []multiaddr.Multiaddr)

type P2pNode

type P2pNode struct {
	PeerID   string
	Identity string

	BootstrapPeers  []string
	ListenAddresses []string

	ExchangeIdentityWithPeersInBackground bool
}

Jump to

Keyboard shortcuts

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