config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Provider string `yaml:"provider,omitempty"`
	Client   struct {
		Options  []ClientOption `yaml:"options,omitempty"`
		Selected string         `yaml:"selected,omitempty"`
		Params   []UserParam    `yaml:"params,omitempty"`
	} `yaml:"client,omitempty"`
}

func (*Chain) GetSelectedClient

func (chain *Chain) GetSelectedClient() *ClientOption

type ClientOption

type ClientOption struct {
	ID             string        `yaml:"id,omitempty"`
	Name           string        `yaml:"name,omitempty"`
	Image          string        `yaml:"image,omitempty"`
	BeaconImage    string        `yaml:"beaconImage,omitempty"`
	ValidatorImage string        `yaml:"validatorImage,omitempty"`
	Params         []ClientParam `yaml:"params,omitempty"`
}

func (*ClientOption) GetBeaconImage

func (client *ClientOption) GetBeaconImage() string

Get the beacon & validator images for a client

func (*ClientOption) GetValidatorImage

func (client *ClientOption) GetValidatorImage() string

type ClientParam

type ClientParam struct {
	Name     string `yaml:"name,omitempty"`
	Env      string `yaml:"env,omitempty"`
	Required bool   `yaml:"required,omitempty"`
	Regex    string `yaml:"regex,omitempty"`
}

type RocketPoolConfig

type RocketPoolConfig struct {
	Rocketpool struct {
		StorageAddress string `yaml:"storageAddress,omitempty"`
	} `yaml:"rocketpool,omitempty"`
	Smartnode struct {
		PasswordPath          string `yaml:"passwordPath,omitempty"`
		WalletPath            string `yaml:"walletPath,omitempty"`
		ValidatorKeychainPath string `yaml:"validatorKeychainPath,omitempty"`
	} `yaml:"smartnode,omitempty"`
	Chains struct {
		Eth1 Chain `yaml:"eth1,omitempty"`
		Eth2 Chain `yaml:"eth2,omitempty"`
	} `yaml:"chains,omitempty"`
}

Rocket Pool config

func Load

func Load(c *cli.Context) (RocketPoolConfig, error)

Load merged config from files

func Merge

func Merge(configs ...*RocketPoolConfig) RocketPoolConfig

Merge configs

func Parse

func Parse(bytes []byte) (RocketPoolConfig, error)

Parse a config from yaml bytes

func (*RocketPoolConfig) GetSelectedEth1Client

func (config *RocketPoolConfig) GetSelectedEth1Client() *ClientOption

Get the selected clients from a config

func (*RocketPoolConfig) GetSelectedEth2Client

func (config *RocketPoolConfig) GetSelectedEth2Client() *ClientOption

func (*RocketPoolConfig) Serialize

func (config *RocketPoolConfig) Serialize() ([]byte, error)

Serialize a config to yaml bytes

type UserParam

type UserParam struct {
	Env   string `yaml:"env,omitempty"`
	Value string `yaml:"value"`
}

Jump to

Keyboard shortcuts

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