Documentation
¶
Overview ¶
Package config enables loading and utilizing configuration options for different blockchain networks
Index ¶
- Constants
- Variables
- func ChainlinkVals() map[string]interface{}
- func GethNetworks() []environment.SimulatedNetwork
- type ChainlinkChart
- type ChainlinkImage
- type ChainlinkValues
- type ChainlinkValuesWrapper
- type ChartOverrides
- type ConfigurationType
- type ETHNetwork
- type FrameworkConfig
- type GethChart
- type GethImage
- type GethValues
- type GethValuesWrapper
- type LocalStore
- type LoggingConfig
- type NetworkSettings
- type NetworksConfig
- type PrivateKeyStore
- type RemoteRunnerConfig
- type TerraNetwork
Constants ¶
const ( LocalConfig ConfigurationType = "local" SecretConfig ConfigurationType = "secret" DefaultGeth string = "geth" PerformanceGeth string = "geth_performance" RealisticGeth string = "geth_realistic" )
Configs
Variables ¶
var ProjectConfigDirectory string
Functions ¶
func ChainlinkVals ¶
func ChainlinkVals() map[string]interface{}
ChainlinkVals formats Chainlink values set in the framework config to be passed to Chainlink deployments
func GethNetworks ¶
func GethNetworks() []environment.SimulatedNetwork
GethNetworks builds the proper geth network settings to use based on the selected_networks config
Types ¶
type ChainlinkChart ¶
type ChainlinkChart struct {
Values *ChainlinkValuesWrapper `json:"values,omitempty"`
}
ChainlinkChart holds the overall geth chart values
type ChainlinkImage ¶
type ChainlinkImage struct {
Image string `json:"image,omitempty" yaml:"chainlink_image"`
Version string `json:"version,omitempty" yaml:"chainlink_version"`
}
ChainlinkImage defines chainlink image and version
type ChainlinkValues ¶
type ChainlinkValues struct {
Image *ChainlinkImage `json:"image,omitempty"`
}
ChainlinkValues wraps all values
type ChainlinkValuesWrapper ¶
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 ¶
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
type ETHNetwork ¶
type ETHNetwork struct {
ContractsDeployed bool `mapstructure:"contracts_deployed" yaml:"contracts_deployed"`
Name string `mapstructure:"name" yaml:"name"`
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 ¶
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 uses interface{} as the value because it's needed for proper helmchart merges
ChainlinkEnvValues map[string]interface{} `mapstructure:"chainlink_env_values" yaml:"chainlink_env_values"`
}
FrameworkConfig common framework config
var ProjectFrameworkSettings *FrameworkConfig
func LoadFrameworkConfig ¶
func LoadFrameworkConfig(cfgPath string) (*FrameworkConfig, error)
LoadFrameworkConfig loads framework config
type GethChart ¶
type GethChart struct {
Values *GethValuesWrapper `json:"values,omitempty"`
}
GethChart holds the overall geth chart values
type GethImage ¶
type GethImage struct {
Image string `json:"image,omitempty" yaml:"geth_image"`
Version string `json:"version,omitempty" yaml:"geth_version"`
}
GethImage defines geth image and version
type GethValues ¶
type GethValues struct {
Image *GethImage `json:"image,omitempty"`
}
GethValues wraps all values
type GethValuesWrapper ¶
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 {
WritePodLogs string `mapstructure:"write_pod_logs" yaml:"write_pod_logs"`
Level int8 `mapstructure:"level" yaml:"level"`
}
LoggingConfig for logging
type NetworkSettings ¶
NetworkSettings is a map that holds configuration for each individual network
func (NetworkSettings) Decode ¶
func (n NetworkSettings) Decode(value string) error
Decode is used by envconfig to initialize 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 ¶
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 ¶
func LoadNetworksConfig(cfgPath string) (*NetworksConfig, error)
LoadNetworksConfig loads networks config
type PrivateKeyStore ¶
PrivateKeyStore enables access, through a variety of methods, to private keys for use in blockchain networks
type RemoteRunnerConfig ¶
type RemoteRunnerConfig struct {
TestRegex string `mapstructure:"test_regex" yaml:"test_regex"`
TestDirectory string `mapstructure:"test_directory" yaml:"test_directory"`
SlackAPIKey string `mapstructure:"slack_api_key" yaml:"slack_api_key"`
SlackChannel string `mapstructure:"slack_channel" yaml:"slack_channel"`
SlackUserID string `mapstructure:"slack_user_id" yaml:"slack_user_id"`
}
RemoteRunnerConfig reads the config file for remote test runs
func ReadWriteRemoteRunnerConfig ¶
func ReadWriteRemoteRunnerConfig() (*RemoteRunnerConfig, error)
ReadWriteRemoteRunnerConfig looks for an already existing remote config to read from, or asks the user to build one
type TerraNetwork ¶
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