config

package
v1.0.37 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 14 Imported by: 0

README

config Package

Fairly self explanatory.

Documentation

Overview

Package config enables loading and utilizing configuration options for different blockchain networks

Index

Constants

This section is empty.

Variables

View Source
var ProjectConfigDirectory string

Functions

This section is empty.

Types

type ChainlinkChart added in v1.0.27

type ChainlinkChart struct {
	Values *ChainlinkValuesWrapper `json:"values,omitempty"`
}

ChainlinkChart holds the overall geth chart values

type ChainlinkImage added in v1.0.27

type ChainlinkImage struct {
	Image   string `json:"image,omitempty" yaml:"chainlink_image"`
	Version string `json:"version,omitempty" yaml:"chainlink_version"`
}

type ChainlinkValues added in v1.0.27

type ChainlinkValues struct {
	Image *ChainlinkImage `json:"image,omitempty"`
}

type ChainlinkValuesWrapper added in v1.0.27

type ChainlinkValuesWrapper struct {
	ChainlinkVals        *ChainlinkValues  `json:"chainlink,omitempty"`
	EnvironmentVariables map[string]string `json:"env,omitempty" yaml:"chainlink_env_values"`
}

ChainlinkValuesWrapper Chainlink values wrapper

type ChartOverrides added in v1.0.27

type ChartOverrides struct {
	GethChartOverride       *GethChart      `json:"geth,omitempty"`
	ChainlinkChartOverrride *ChainlinkChart `json:"chainlink,omitempty"`
}

ChartOverrides enables building json styled chart overrides for the deployed chart values and environment variables

type ConfigurationType

type ConfigurationType string

ConfigurationType refers to the different ways that configurations can be set

const (
	LocalConfig  ConfigurationType = "local"
	SecretConfig ConfigurationType = "secret"
)

Configs

type ETHNetwork added in v0.0.25

type ETHNetwork struct {
	ContractsDeployed         bool          `mapstructure:"contracts_deployed" yaml:"contracts_deployed"`
	External                  bool          `mapstructure:"external" yaml:"external"`
	Name                      string        `mapstructure:"name" yaml:"name"`
	ID                        string        `mapstructure:"id" yaml:"id"`
	ChainID                   int64         `mapstructure:"chain_id" yaml:"chain_id"`
	URL                       string        `mapstructure:"url" yaml:"url"`
	URLs                      []string      `mapstructure:"urls" yaml:"urls"`
	Type                      string        `mapstructure:"type" yaml:"type"`
	PrivateKeys               []string      `mapstructure:"private_keys" yaml:"private_keys"`
	ChainlinkTransactionLimit uint64        `mapstructure:"chainlink_transaction_limit" yaml:"chainlink_transaction_limit"`
	Timeout                   time.Duration `mapstructure:"transaction_timeout" yaml:"transaction_timeout"`
	MinimumConfirmations      int           `mapstructure:"minimum_confirmations" yaml:"minimum_confirmations"`
	GasEstimationBuffer       uint64        `mapstructure:"gas_estimation_buffer" yaml:"gas_estimation_buffer"`
	BlockGasLimit             uint64        `mapstructure:"block_gas_limit" yaml:"block_gas_limit"`
}

ETHNetwork data to configure fully ETH compatible network

type FrameworkConfig added in v0.0.25

type FrameworkConfig struct {
	KeepEnvironments   string            `mapstructure:"keep_environments" yaml:"keep_environments"`
	Logging            *LoggingConfig    `mapstructure:"logging" yaml:"logging"`
	EnvironmentFile    string            `mapstructure:"environment_file" yaml:"environment_file"`
	ChainlinkImage     string            `mapstructure:"chainlink_image" yaml:"chainlink_image"`
	ChainlinkVersion   string            `mapstructure:"chainlink_version" yaml:"chainlink_version"`
	ChainlinkEnvValues map[string]string `mapstructure:"chainlink_env_values" yaml:"chainlink_env_values"`
	GethImage          string            `mapstructure:"geth_image" yaml:"geth_image"`
	GethVersion        string            `mapstructure:"geth_version" yaml:"geth_version"`
	GethArgs           []interface{}     `mapstructure:"geth_args" yaml:"geth_args"`
}

FrameworkConfig common framework config

var ProjectFrameworkSettings *FrameworkConfig

func LoadFrameworkConfig added in v0.0.25

func LoadFrameworkConfig(cfgPath string) (*FrameworkConfig, error)

LoadFrameworkConfig loads framework config

func (*FrameworkConfig) CreateChartOverrrides added in v1.0.27

func (cfg *FrameworkConfig) CreateChartOverrrides() (string, error)

CreateChartOverrrides checks the framework config to see if the user has supplied any values to override the default helm chart values. It returns a JSON block that can be set to the `CHARTS` environment variable that the helmenv library will read from. This will merge the override values with the default values for the appropriate charts.

type GethChart added in v1.0.27

type GethChart struct {
	Values *GethValuesWrapper `json:"values,omitempty"`
}

GethChart holds the overall geth chart values

type GethImage added in v1.0.27

type GethImage struct {
	Image   string `json:"image,omitempty" yaml:"geth_image"`
	Version string `json:"version,omitempty" yaml:"get_version"`
}

type GethValues added in v1.0.27

type GethValues struct {
	Image *GethImage `json:"image,omitempty"`
}

type GethValuesWrapper added in v1.0.27

type GethValuesWrapper struct {
	GethVals *GethValues   `json:"geth,omitempty"`
	Args     []interface{} `json:"args,omitempty"`
}

GethValuesWrapper geth values wrapper

type LocalStore

type LocalStore struct {
	RawKeys []string
}

LocalStore retrieves keys defined in a networks.yaml file, or from environment variables

func (*LocalStore) Fetch

func (l *LocalStore) Fetch() ([]string, error)

Fetch private keys from local environment variables or a config file

type LoggingConfig

type LoggingConfig struct {
	Level int8 `mapstructure:"level" yaml:"logging"`
}

LoggingConfig for logging

type NetworkSettings added in v0.0.27

type NetworkSettings map[string]map[string]interface{}

NetworkSettings is a map that holds configuration for each individual network

func (NetworkSettings) Decode added in v0.0.27

func (n NetworkSettings) Decode(value string) error

Decode is used by envconfig to initialise the custom Charts type with populated values This function will take a JSON object representing charts, and unmarshal it into the existing object to "merge" the two

type NetworksConfig added in v0.0.25

type NetworksConfig struct {
	SelectedNetworks   []string        `mapstructure:"selected_networks" yaml:"selected_networks" envconfig:"selected_networks"`
	NetworkSettings    NetworkSettings `mapstructure:"networks" yaml:"networks" envconfig:"network_settings"`
	DefaultKeyStore    string
	ConfigFileLocation string
}

NetworksConfig is network configurations

var ProjectNetworkSettings *NetworksConfig

func LoadNetworksConfig added in v0.0.25

func LoadNetworksConfig(cfgPath string) (*NetworksConfig, error)

LoadNetworksConfig loads networks config

type PrivateKeyStore

type PrivateKeyStore interface {
	Fetch() ([]string, error)
}

PrivateKeyStore enables access, through a variety of methods, to private keys for use in blockchain networks

type TerraNetwork added in v0.0.25

type TerraNetwork struct {
	Name                      string        `mapstructure:"name" yaml:"name"`
	ChainName                 string        `mapstructure:"chain_name" yaml:"chain_name"`
	Mnemonics                 []string      `mapstructure:"mnemonic" yaml:"mnemonic"`
	Currency                  string        `mapstructure:"currency" yaml:"currency"`
	Type                      string        `mapstructure:"type" yaml:"type"`
	ChainlinkTransactionLimit uint64        `mapstructure:"chainlink_transaction_limit" yaml:"chainlink_transaction_limit"`
	Timeout                   time.Duration `mapstructure:"transaction_timeout" yaml:"transaction_timeout"`
	MinimumConfirmations      int           `mapstructure:"minimum_confirmations" yaml:"minimum_confirmations"`
}

TerraNetwork data to configure Terra network

Jump to

Keyboard shortcuts

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