config

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterConfig

type AdapterConfig struct {
	Requests ResourcesConfig `mapstructure:"requests" yaml:"requests"`
	Limits   ResourcesConfig `mapstructure:"limits" yaml:"limits"`
}

AdapterConfig holds the configuration for the adapter pods to be deployed

type AppConfig

type AppConfig struct {
	Chainlink ChainlinkConfig `mapstructure:"chainlink" yaml:"chainlink"`
	Geth      GethConfig      `mapstructure:"geth" yaml:"geth"`
	Adapter   AdapterConfig   `mapstructure:"adapter" yaml:"adapter"`
	Postgres  PostgresConfig  `mapstructure:"postgres" yaml:"postgres"`
	Otpe      OtpeConfig      `mapstructure:"otpe" yaml:"otpe"`
	Explorer  ExplorerConfig  `mapstructure:"explorer" yaml:"explorer"`
}

AppConfig holds all the configuration for the core apps that are deployed for testing

type ChainlinkConfig

type ChainlinkConfig struct {
	Image    string          `mapstructure:"image" yaml:"image"`
	Version  string          `mapstructure:"version" yaml:"version"`
	Requests ResourcesConfig `mapstructure:"requests" yaml:"requests"`
	Limits   ResourcesConfig `mapstructure:"limits" yaml:"limits"`
}

ChainlinkConfig holds the configuration for the chainlink nodes to be deployed

type Config

type Config struct {
	Networks           []string                 `mapstructure:"networks" yaml:"networks"`
	Logging            *LoggingConfig           `mapstructure:"logging" yaml:"logging"`
	NetworkConfigs     map[string]NetworkConfig `mapstructure:"network_configs" yaml:"network_configs"`
	Retry              *RetryConfig             `mapstructure:"retry" yaml:"retry"`
	Apps               AppConfig                `mapstructure:"apps" yaml:"apps"`
	Kubernetes         KubernetesConfig         `mapstructure:"kubernetes" yaml:"kubernetes"`
	KeepEnvironments   string                   `mapstructure:"keep_environments" yaml:"keep_environments"`
	Prometheus         *PrometheusConfig        `mapstructure:"prometheus" yaml:"prometheus"`
	Contracts          *ContractsConfig         `mapstructure:"contracts" yaml:"contracts"`
	DefaultKeyStore    string
	ConfigFileLocation string
}

Config is the overall config for the framework, holding configurations for supported networks

func NewConfig

func NewConfig(configPath string) (*Config, error)

NewConfig creates a new configuration instance via viper from env vars, config file, or a secret store

func (*Config) GetNetworkConfig

func (c *Config) GetNetworkConfig(name string) (NetworkConfig, error)

GetNetworkConfig finds a specified network config based on its name

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 ContractsConfig added in v0.0.2

type ContractsConfig struct {
	Ethereum EthereumSources `mapstructure:"ethereum" yaml:"ethereum"`
}

ContractsConfig contracts sources config

type EthereumSources added in v0.0.2

type EthereumSources struct {
	ExecutablePath string     `mapstructure:"executable_path" yaml:"executable_path"`
	OutPath        string     `mapstructure:"out_path" yaml:"out_path"`
	Sources        SourcesMap `mapstructure:"sources" yaml:"sources"`
}

EthereumSources sources to generate bindings to ethereum contracts

type ExplorerConfig added in v0.0.3

type ExplorerConfig struct {
	Image   string `mapstructure:"image" yaml:"image"`
	Version string `mapstructure:"version" yaml:"version"`
}

ExplorerConfig holds the configuration for the explorer to be deployed

type ExternalSource added in v0.0.2

type ExternalSource struct {
	Path   string `mapstructure:"path" yaml:"path"`
	Commit string `mapstructure:"commit" yaml:"commit"`
}

ExternalSource remote contracts artifacts source directory

type ExternalSources added in v0.0.2

type ExternalSources struct {
	RootPath     string                    `mapstructure:"path" yaml:"path"`
	Region       string                    `mapstructure:"region" yaml:"region"`
	S3URL        string                    `mapstructure:"s3_path" yaml:"s3_path"`
	Repositories map[string]ExternalSource `mapstructure:"repositories" yaml:"repositories"`
}

ExternalSources are sources downloaded from remote

type GethConfig

type GethConfig struct {
	Requests ResourcesConfig `mapstructure:"requests" yaml:"requests"`
	Limits   ResourcesConfig `mapstructure:"limits" yaml:"limits"`
}

GethConfig holds the configuration for the geth pods to be deployed

type KubernetesConfig

type KubernetesConfig struct {
	QPS               float32       `mapstructure:"qps" yaml:"qps"`
	Burst             int           `mapstructure:"burst" yaml:"burst"`
	DeploymentTimeout time.Duration `mapstructure:"deployment_timeout" yaml:"deployment_timeout"`
}

KubernetesConfig holds the configuration for how the framework interacts with the k8s cluster

type LocalSource added in v0.0.2

type LocalSource struct {
	Path string `mapstructure:"path" yaml:"path"`
}

LocalSource local contracts artifacts directory

type LocalStore

type LocalStore struct {
	RawKeys []string
}

LocalStore retrieves keys defined in a config.yml 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 NetworkConfig

type NetworkConfig 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"`
	ClusterURL           string
	LocalURL             string
	URLS                 []string      `mapstructure:"urls" yaml:"urls"`
	ChainID              int64         `mapstructure:"chain_id" yaml:"chain_id"`
	Type                 string        `mapstructure:"type" yaml:"type"`
	SecretPrivateKeys    bool          `mapstructure:"secret_private_keys" yaml:"secret_private_keys"`
	SecretPrivateURL     bool          `mapstructure:"secret_private_url" yaml:"secret_private_url"`
	NamespaceForSecret   string        `mapstructure:"namespace_for_secret" yaml:"namespace_for_secret"`
	PrivateKeys          []string      `mapstructure:"private_keys" yaml:"private_keys"`
	PrivateURL           string        `mapstructure:"private_url" yaml:"private_url"`
	TransactionLimit     uint64        `mapstructure:"transaction_limit" yaml:"transaction_limit"`
	Timeout              time.Duration `mapstructure:"transaction_timeout" yaml:"transaction_timeout"`
	LinkTokenAddress     string        `mapstructure:"link_token_address" yaml:"link_token_address"`
	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"`
	RPCPort              uint16        `mapstructure:"rpc_port" yaml:"rpc_port"`
	PrivateKeyStore      PrivateKeyStore
}

NetworkConfig holds the basic values that identify a blockchain network and contains private keys on the network

type OtpeConfig added in v0.0.5

type OtpeConfig struct {
	Image   string `mapstructure:"image" yaml:"image"`
	Version string `mapstructure:"version" yaml:"version"`
}

OtpeConfig holds the configuration for the otpe to be deployed

type PostgresConfig added in v0.0.2

type PostgresConfig struct {
	Requests ResourcesConfig `mapstructure:"requests" yaml:"requests"`
	Limits   ResourcesConfig `mapstructure:"limits" yaml:"limits"`
}

PostgresConfig holds the configuration for the postgres pods to be deployed

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 PrometheusConfig

type PrometheusConfig struct {
	URL string `mapstructure:"url" yaml:"url"`
}

PrometheusConfig for prometheus

type ResourcesConfig

type ResourcesConfig struct {
	Memory string `mapstructure:"memory" yaml:"memory"`
	Cpu    string `mapstructure:"cpu" yaml:"cpu"`
}

ResourcesConfig hols the resource usage configuration for a pod

type RetryConfig

type RetryConfig struct {
	Attempts    uint          `mapstructure:"attempts" yaml:"attempts"`
	LinearDelay time.Duration `mapstructure:"linear_delay" yaml:"linear_delay"`
}

RetryConfig holds config for retry attempts and delays

type SourcesMap added in v0.0.2

type SourcesMap struct {
	Local    LocalSource     `mapstructure:"local" yaml:"local"`
	External ExternalSources `mapstructure:"external" yaml:"external"`
}

SourcesMap describes different sources types, local or remote s3 (external)

Jump to

Keyboard shortcuts

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