environment

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//RunningDev   RunningMode = "dev"
	RunningDev RunningMode = "dev"
	//RunningTest  RunningMode = "test"
	RunningTest RunningMode = "test"
	RunningMain RunningMode = "prod"

	// Orphanage is the default farmid where nodes are registered
	// if no farmid were specified on the kernel command line
	OrphanageDev  pkg.FarmID = 0
	OrphanageTest pkg.FarmID = 0
	OrphanageMain pkg.FarmID = 0
)

Possible running mode of a node

Variables

This section is empty.

Functions

func GetSubstrate added in v0.5.5

func GetSubstrate() (substrate.Manager, error)

GetSubstrate gets a client to subsrate blockchain

Types

type Config added in v0.5.5

type Config struct {
	// Monitor is a list of twins that need to updated continuesly
	// with node free capacity and status.
	Monitor   []uint32 `json:"monitor"`
	Yggdrasil struct {
		Peers []string `json:"peers"`
	} `json:"yggdrasil"`
}

Config is configuration set by the organization

func GetConfig added in v0.5.5

func GetConfig() (base Config, err error)

GetConfig returns extend config for specific run mode

func (*Config) Merge added in v0.5.5

func (c *Config) Merge(cfg Config)

Merge, updates current config with cfg merging and override config based on some update rules.

type Environment

type Environment struct {
	RunningMode RunningMode

	FlistURL string
	BinRepo  string

	FarmerID pkg.FarmID
	Orphan   bool

	FarmSecret    string
	SubstrateURL  []string
	ActivationURL string

	ExtendedConfigURL string
}

Environment holds information about running environment of a node it defines the different constant based on the running mode (dev, test, prod)

func Get

func Get() (Environment, error)

Get return the running environment of the node

func MustGet added in v0.5.5

func MustGet() Environment

MustGet returns the running environment of the node panics on error

type RunningMode

type RunningMode string

RunningMode type

func (RunningMode) String

func (r RunningMode) String() string

Jump to

Keyboard shortcuts

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