config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort         = uint(0)
	DefaultAddress      = "0.0.0.0"
	DefaultRole         = "worker"
	DefaultPeerDB       = "peer-db"
	DefaultFunctionDB   = "function-db"
	DefaultConcurrency  = uint(node.DefaultConcurrency)
	DefaultUseWebsocket = false
	DefaultWorkspace    = "workspace"
)

Default values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Role           string   `koanf:"role"`
	Concurrency    uint     `koanf:"concurrency"`
	BootNodes      []string `koanf:"boot-nodes"`
	Workspace      string   `koanf:"workspace"`  // TODO: Check - does a head node ever use a workspace?
	LoadAttributes bool     `koanf:"attributes"` // TODO: Head node probably doesn't need attributes..?
	Topics         []string `koanf:"topics"`

	PeerDatabasePath     string `koanf:"peer-db"`
	FunctionDatabasePath string `koanf:"function-db"` // TODO: Head node doesn't need a function database.

	Log          Log          `koanf:"log"`
	Connectivity Connectivity `koanf:"connectivity"`
	Head         Head         `koanf:"head"`
	Worker       Worker       `koanf:"worker"`
}

Config describes the Blockless configuration options.

func Load

func Load(args ...string) (*Config, error)

type Connectivity

type Connectivity struct {
	Address               string `koanf:"address"`
	Port                  uint   `koanf:"port"`
	PrivateKey            string `koanf:"private-key"`
	DialbackAddress       string `koanf:"dialback-address"`
	DialbackPort          uint   `koanf:"dialback-port"`
	Websocket             bool   `koanf:"websocket"`
	WebsocketPort         uint   `koanf:"websocket-port"`
	WebsocketDialbackPort uint   `koanf:"websocket-dialback-port"`
}

Connectivity describes the libp2p host that the node will use.

type Head struct {
	API string `koanf:"rest-api"`
}

type Log

type Log struct {
	Level string `koanf:"level"`
}

Log describes the logging configuration.

type Worker

type Worker struct {
	RuntimePath        string  `koanf:"runtime-path"`
	RuntimeCLI         string  `koanf:"runtime-cli"`
	CPUPercentageLimit float64 `koanf:"cpu-percentage-limit"`
	MemoryLimitKB      int64   `koanf:"memory-limit"`
}

Jump to

Keyboard shortcuts

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