Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToAnyTomlStruct(logger zerolog.Logger, filename, configurationName string, target any, ...) error
- func MightConfigOverridePyroscopeKey(config *PyroscopeConfig, target interface{})
- func MustConfigOverrideChainlinkVersion(config *ChainlinkImageConfig, target interface{})
- type AnvilConfig
- type ChainlinkImageConfig
- type ConsensusLayer
- type ConsensusTypedeprecated
- type ContainerType
- type EthereumChainConfig
- func (c *EthereumChainConfig) ApplyOverrides(from *EthereumChainConfig) error
- func (c *EthereumChainConfig) Default() error
- func (c *EthereumChainConfig) FillInMissingValuesWithDefault()
- func (c *EthereumChainConfig) GenerateGenesisTimestamp()
- func (c *EthereumChainConfig) GetDefaultFinalizationWaitDuration() time.Duration
- func (c *EthereumChainConfig) GetDefaultWaitDuration() time.Duration
- func (c *EthereumChainConfig) GetValidatorBasedGenesisDelay() int
- func (c *EthereumChainConfig) Validate(logger zerolog.Logger, ethereumVersion *EthereumVersion) error
- func (c *EthereumChainConfig) ValidateHardForks() error
- type EthereumNetworkConfig
- type EthereumNetworkContainer
- type EthereumNetworkContainers
- type EthereumVersion
- type ExecutionLayer
- type GasLimitSimulationConfig
- type GasSpikeSimulationConfig
- type GlobalTestConfig
- type GrafanaConfig
- type LogStreamConfig
- type LoggingConfig
- type LokiConfig
- type NamedConfiguration
- type NetworkConfig
- type NodeConfig
- type PyroscopeConfig
- type ReorgConfig
- type SethConfig
- type TestConfig
- func (c TestConfig) GetChainlinkImageConfig() *ChainlinkImageConfig
- func (c *TestConfig) GetLoggingConfig() *LoggingConfig
- func (c TestConfig) GetNetworkConfig() *NetworkConfig
- func (c *TestConfig) GetNodeConfig() *NodeConfig
- func (c TestConfig) GetPrivateEthereumNetworkConfig() *EthereumNetworkConfig
- func (c TestConfig) GetPyroscopeConfig() *PyroscopeConfig
- type WaspAutoBuildConfig
Constants ¶
const (
Base64NetworkConfigEnvVarName = "BASE64_NETWORK_CONFIG"
)
const (
UnsopportedForkErr = "only Deneb hard fork is supported"
)
Variables ¶
var ( ErrMissingEthereumVersion = errors.New("ethereum version is required") ErrMissingExecutionLayer = errors.New("execution layer is required") DefaultNodeLogLevel = "info" )
Functions ¶
func BytesToAnyTomlStruct ¶ added in v1.23.0
func BytesToAnyTomlStruct(logger zerolog.Logger, filename, configurationName string, target any, content []byte) error
BytesToAnyTomlStruct unmarshals the given bytes into the given target struct, apart from unmarshalling the root it also looks for given configuration name and unmarshals it into the target struct overwriting the root. Target needs to be a struct with exported fields with `toml:"field_name"` tags.
func MightConfigOverridePyroscopeKey ¶ added in v1.23.0
func MightConfigOverridePyroscopeKey(config *PyroscopeConfig, target interface{})
MightConfigOverridePyroscope will override the pyroscope config in property maps from the passed config. If the config is nil, or the enabled flag is not set, or the key is not set, then this function will do nothing.
func MustConfigOverrideChainlinkVersion ¶ added in v1.23.0
func MustConfigOverrideChainlinkVersion(config *ChainlinkImageConfig, target interface{})
MustConfigOverrideChainlinkVersion will override the chainlink image and version in property maps from the passed config. It will panic if the config is nil.
Types ¶
type AnvilConfig ¶ added in v1.28.5
type AnvilConfig struct { URL *string `toml:"url,omitempty"` // Needed if you want to fork a network. URL is the URL of the node to fork from. Refer to https://book.getfoundry.sh/reference/anvil/#options BlockNumber *int64 `toml:"block_number,omitempty"` // Needed if fork URL is provided for forking. BlockNumber is the block number to fork from. Refer to https://book.getfoundry.sh/reference/anvil/#options BlockTime *int64 `toml:"block_time,omitempty"` // how frequent blocks are mined. By default, it automatically generates a new block as soon as a transaction is submitted. Refer to https://book.getfoundry.sh/reference/anvil/#options BlockGaslimit *int64 `toml:"block_gaslimit,omitempty"` // BlockGaslimit is the gas limit for each block. Refer to https://book.getfoundry.sh/reference/anvil/#options CodeSize *int64 `toml:"code_size,omitempty"` // CodeSize is the size of the code in bytes. Refer to https://book.getfoundry.sh/reference/anvil/#options BaseFee *int64 `toml:"base_fee,omitempty"` // BaseFee is the base fee for block. Refer to https://book.getfoundry.sh/reference/anvil/#options Retries *int `toml:"retries,omitempty"` // Needed if fork URL is provided for forking. Number of retry requests for spurious networks (timed out requests). Refer to https://book.getfoundry.sh/reference/anvil/#options Timeout *int64 `toml:"timeout,omitempty"` // Needed if fork URL is provided for forking. Timeout in ms for requests sent to remote JSON-RPC server in forking mode. Refer to https://book.getfoundry.sh/reference/anvil/#options ComputePerSecond *int64 `toml:"compute_per_second,omitempty"` // Needed if fork URL is provided for forking. Sets the number of assumed available compute units per second for this provider. Refer to https://book.getfoundry.sh/reference/anvil/#options RateLimitDisabled *bool `toml:"rate_limit_disabled,omitempty"` // Needed if fork URL is provided for forking. Rate limiting for this node’s provider. If set to true the node will start with --no-rate-limit Refer to https://book.getfoundry.sh/reference/anvil/#options NoOfAccounts *int `toml:"no_of_accounts,omitempty"` // Number of accounts to generate. Refer to https://book.getfoundry.sh/reference/anvil/#options EnableTracing *bool `toml:"enable_tracing,omitempty"` // Enable tracing for the node. Refer to https://book.getfoundry.sh/reference/anvil/#options GasSpikeSimulation GasSpikeSimulationConfig `toml:"GasSpikeSimulation,omitempty"` GasLimitSimulation GasLimitSimulationConfig `toml:"GasLimitSimulation,omitempty"` }
type ChainlinkImageConfig ¶ added in v1.23.0
type ChainlinkImageConfig struct { Image *string `toml:"image"` Version *string `toml:"version"` PostgresVersion *string `toml:"postgres_version,omitempty"` }
func (*ChainlinkImageConfig) Validate ¶ added in v1.23.0
func (c *ChainlinkImageConfig) Validate() error
Validate checks that the chainlink image config is valid, which means that both image and version are set and non-empty
type ConsensusLayer ¶ added in v1.28.8
type ConsensusLayer string
var ConsensusLayer_Prysm ConsensusLayer = "prysm"
type ConsensusType
deprecated
added in
v1.28.8
type ConsensusType string
Deprecated: use EthereumVersion instead
const ( // Deprecated: use EthereumVersion_Eth2 instead ConsensusType_PoS ConsensusType = "pos" // Deprecated: use EthereumVersion_Eth1 instead ConsensusType_PoW ConsensusType = "pow" )
type ContainerType ¶ added in v1.28.8
type ContainerType string
const ( ContainerType_ExecutionLayer ContainerType = "execution_layer" ContainerType_ConsensusLayer ContainerType = "consensus_layer" ContainerType_ConsensusValidator ContainerType = "consensus_validator" ContainerType_GenesisGenerator ContainerType = "genesis_generator" ContainerType_ValKeysGenerator ContainerType = "val_keys_generator" )
type EthereumChainConfig ¶ added in v1.28.8
type EthereumChainConfig struct { SecondsPerSlot int `json:"seconds_per_slot" toml:"seconds_per_slot"` SlotsPerEpoch int `json:"slots_per_epoch" toml:"slots_per_epoch"` GenesisDelay int `json:"genesis_delay" toml:"genesis_delay"` ValidatorCount int `json:"validator_count" toml:"validator_count"` ChainID int `json:"chain_id" toml:"chain_id"` GenesisTimestamp int // this is not serialized AddressesToFund []string `json:"addresses_to_fund" toml:"addresses_to_fund"` HardForkEpochs map[string]int `json:"HardForkEpochs" toml:"HardForkEpochs"` }
func GetDefaultChainConfig ¶ added in v1.28.8
func GetDefaultChainConfig() EthereumChainConfig
func (*EthereumChainConfig) ApplyOverrides ¶ added in v1.28.8
func (c *EthereumChainConfig) ApplyOverrides(from *EthereumChainConfig) error
func (*EthereumChainConfig) Default ¶ added in v1.28.8
func (c *EthereumChainConfig) Default() error
func (*EthereumChainConfig) FillInMissingValuesWithDefault ¶ added in v1.28.8
func (c *EthereumChainConfig) FillInMissingValuesWithDefault()
func (*EthereumChainConfig) GenerateGenesisTimestamp ¶ added in v1.28.8
func (c *EthereumChainConfig) GenerateGenesisTimestamp()
func (*EthereumChainConfig) GetDefaultFinalizationWaitDuration ¶ added in v1.28.8
func (c *EthereumChainConfig) GetDefaultFinalizationWaitDuration() time.Duration
func (*EthereumChainConfig) GetDefaultWaitDuration ¶ added in v1.28.8
func (c *EthereumChainConfig) GetDefaultWaitDuration() time.Duration
func (*EthereumChainConfig) GetValidatorBasedGenesisDelay ¶ added in v1.28.8
func (c *EthereumChainConfig) GetValidatorBasedGenesisDelay() int
func (*EthereumChainConfig) Validate ¶ added in v1.28.8
func (c *EthereumChainConfig) Validate(logger zerolog.Logger, ethereumVersion *EthereumVersion) error
func (*EthereumChainConfig) ValidateHardForks ¶ added in v1.28.8
func (c *EthereumChainConfig) ValidateHardForks() error
type EthereumNetworkConfig ¶ added in v1.28.8
type EthereumNetworkConfig struct { ConsensusType *EthereumVersion `toml:"consensus_type"` EthereumVersion *EthereumVersion `toml:"ethereum_version"` ConsensusLayer *ConsensusLayer `toml:"consensus_layer"` ExecutionLayer *ExecutionLayer `toml:"execution_layer"` DockerNetworkNames []string `toml:"docker_network_names"` Containers EthereumNetworkContainers `toml:"containers"` WaitForFinalization *bool `toml:"wait_for_finalization"` GeneratedDataHostDir *string `toml:"generated_data_host_dir"` ValKeysDir *string `toml:"val_keys_dir"` EthereumChainConfig *EthereumChainConfig `toml:"EthereumChainConfig"` CustomDockerImages map[ContainerType]string `toml:"CustomDockerImages"` NodeLogLevel *string `toml:"node_log_level,omitempty"` }
func (*EthereumNetworkConfig) ApplyOverrides ¶ added in v1.28.8
func (en *EthereumNetworkConfig) ApplyOverrides(from *EthereumNetworkConfig) error
func (*EthereumNetworkConfig) Describe ¶ added in v1.28.8
func (en *EthereumNetworkConfig) Describe() string
func (*EthereumNetworkConfig) Validate ¶ added in v1.28.8
func (en *EthereumNetworkConfig) Validate() error
type EthereumNetworkContainer ¶ added in v1.28.8
type EthereumNetworkContainer struct { ContainerName string `toml:"container_name"` ContainerType ContainerType `toml:"container_type"` Container *tc.Container `toml:"-"` }
type EthereumNetworkContainers ¶ added in v1.28.8
type EthereumNetworkContainers []EthereumNetworkContainer
type EthereumVersion ¶ added in v1.28.8
type EthereumVersion string
const ( EthereumVersion_Eth2 EthereumVersion = "eth2" // Deprecated: use EthereumVersion_Eth2 instead EthereumVersion_Eth2_Legacy EthereumVersion = "pos" EthereumVersion_Eth1 EthereumVersion = "eth1" // Deprecated: use EthereumVersion_Eth1 instead EthereumVersion_Eth1_Legacy EthereumVersion = "pow" )
type ExecutionLayer ¶ added in v1.28.8
type ExecutionLayer string
const ( ExecutionLayer_Geth ExecutionLayer = "geth" ExecutionLayer_Nethermind ExecutionLayer = "nethermind" ExecutionLayer_Erigon ExecutionLayer = "erigon" ExecutionLayer_Besu ExecutionLayer = "besu" )
type GasLimitSimulationConfig ¶ added in v1.30.9
type GasLimitSimulationConfig struct { Enabled bool `toml:"enabled,omitempty"` NextGasLimitPercentage float64 `toml:"next_gas_limit_percentage,omitempty"` // Percentage of last gasUsed in previous block creating congestion DelayCreate blockchain.StrDuration `toml:"delay_create,omitempty"` // Delay before creating, expressed in Go duration format (e.g., "1m", "30s") Duration blockchain.StrDuration `toml:"duration,omitempty"` // Duration of the gas simulation, expressed in Go duration format (e.g., "1m", "30s") }
GasLimitSimulationConfig is the configuration for simulating gas limit changes on the network
type GasSpikeSimulationConfig ¶ added in v1.30.9
type GasSpikeSimulationConfig struct { Enabled bool `toml:"enabled,omitempty"` StartGasPrice int64 `toml:"start_gas_price,omitempty"` GasRisePercentage float64 `toml:"gas_rise_percentage,omitempty"` GasSpike bool `toml:"gas_spike,omitempty"` DelayCreate blockchain.StrDuration `toml:"delay_create,omitempty"` // Delay before creating, expressed in Go duration format (e.g., "1m", "30s") Duration blockchain.StrDuration `toml:"duration,omitempty"` // Duration of the gas simulation, expressed in Go duration format (e.g., "1m", "30s") }
GasSpikeSimulation is the configuration for simulating gas spikes on the network
type GlobalTestConfig ¶ added in v1.28.8
type GlobalTestConfig interface { GetChainlinkImageConfig() *ChainlinkImageConfig GetLoggingConfig() *LoggingConfig GetNetworkConfig() *NetworkConfig GetPrivateEthereumNetworkConfig() *EthereumNetworkConfig GetPyroscopeConfig() *PyroscopeConfig GetNodeConfig() *NodeConfig SethConfig }
type GrafanaConfig ¶ added in v1.23.0
type GrafanaConfig struct { BaseUrl *string `toml:"base_url"` DashboardUrl *string `toml:"dashboard_url"` BearerToken *string `toml:"bearer_token_secret"` }
func (*GrafanaConfig) Validate ¶ added in v1.23.0
func (c *GrafanaConfig) Validate() error
Validate checks that the grafana config is valid, which means that base url is a valid URL and dashboard url and bearer token are not empty but that only applies if they are set
type LogStreamConfig ¶ added in v1.23.0
type LogStreamConfig struct { LogTargets []string `toml:"log_targets"` LogProducerTimeout *blockchain.StrDuration `toml:"log_producer_timeout"` LogProducerRetryLimit *uint `toml:"log_producer_retry_limit"` }
func (*LogStreamConfig) Validate ¶ added in v1.23.0
func (l *LogStreamConfig) Validate() error
Validate checks that the log stream config is valid, which means that log targets are valid and log producer timeout is greater than 0
type LoggingConfig ¶
type LoggingConfig struct { TestLogCollect *bool `toml:"test_log_collect,omitempty"` ShowHTMLCoverageReport *bool `toml:"show_html_coverage_report,omitempty"` // Show reports with go coverage data RunId *string `toml:"run_id,omitempty"` Loki *LokiConfig `toml:"Loki,omitempty"` Grafana *GrafanaConfig `toml:"Grafana,omitempty"` LogStream *LogStreamConfig `toml:"LogStream,omitempty"` }
func (*LoggingConfig) Validate ¶ added in v1.23.0
func (l *LoggingConfig) Validate() error
Validate executes config validation for LogStream, Grafana and Loki
type LokiConfig ¶ added in v1.23.0
type LokiConfig struct { TenantId *string `toml:"tenant_id"` Endpoint *string `toml:"endpoint"` BasicAuth *string `toml:"basic_auth_secret"` BearerToken *string `toml:"bearer_token_secret"` }
func (*LokiConfig) Validate ¶ added in v1.23.0
func (l *LokiConfig) Validate() error
Validate checks that the loki config is valid, which means that endpoint is a valid URL and tenant id is not empty
type NamedConfiguration ¶ added in v1.28.8
type NamedConfiguration interface {
GetConfigurationName() string
}
type NetworkConfig ¶ added in v1.23.0
type NetworkConfig struct { SelectedNetworks []string `toml:"selected_networks,omitempty"` // EVMNetworks is the configuration for the EVM networks, key is the network name as declared in selected_networks slice. // if not set, it will try to find the network from defined networks in MappedNetworks under known_networks.go EVMNetworks map[string]*blockchain.EVMNetwork `toml:"EVMNetworks,omitempty"` // AnvilConfigs is the configuration for forking from a node, // key is the network name as declared in selected_networks slice AnvilConfigs map[string]*AnvilConfig `toml:"AnvilConfigs,omitempty"` // GethReorgConfig is the configuration for handling reorgs on Simulated Geth GethReorgConfig ReorgConfig `toml:"GethReorgConfig,omitempty"` // RpcHttpUrls is the RPC HTTP endpoints for each network, // key is the network name as declared in selected_networks slice RpcHttpUrls map[string][]string `toml:"RpcHttpUrls,omitempty"` // RpcWsUrls is the RPC WS endpoints for each network, // key is the network name as declared in selected_networks slice RpcWsUrls map[string][]string `toml:"RpcWsUrls,omitempty"` // WalletKeys is the private keys for the funding wallets for each network, // key is the network name as declared in selected_networks slice WalletKeys map[string][]string `toml:"WalletKeys,omitempty"` }
NetworkConfig is the configuration for the networks to be used
func (*NetworkConfig) Default ¶ added in v1.23.0
func (n *NetworkConfig) Default() error
Default applies default values to the network config after reading it from BASE64_NETWORK_CONFIG env var. It will only fill in the gaps, not override meaning that if you provided WS RPC endpoint in your network config, but not the HTTP one, then only HTTP will be taken from default config (provided it's there)
func (NetworkConfig) IsSimulatedGethSelected ¶ added in v1.30.3
func (n NetworkConfig) IsSimulatedGethSelected() bool
func (*NetworkConfig) OverrideURLsAndKeysFromEVMNetwork ¶ added in v1.24.0
func (n *NetworkConfig) OverrideURLsAndKeysFromEVMNetwork()
OverrideURLsAndKeysFromEVMNetwork applies the URLs and keys from the EVMNetworks to the NetworkConfig it overrides the URLs and Keys present in RpcHttpUrls, RpcWsUrls and WalletKeys in the NetworkConfig with the URLs and Keys provided in the EVMNetworks
func (*NetworkConfig) UpperCaseNetworkNames ¶ added in v1.23.0
func (n *NetworkConfig) UpperCaseNetworkNames()
UpperCaseNetworkNames converts all network name keys for wallet keys, rpc endpoints maps and selected network slice to upper case
func (*NetworkConfig) Validate ¶ added in v1.23.0
func (n *NetworkConfig) Validate() error
Validate checks if all required fields are set, meaning that there must be at least 1 selected network and unless it's a simulated network, there must be at least 1 rpc endpoint for HTTP and WS and 1 private key for funding wallet
type NodeConfig ¶ added in v1.28.12
type PyroscopeConfig ¶ added in v1.23.0
type PyroscopeConfig struct { Enabled *bool `toml:"enabled"` ServerUrl *string `toml:"server_url"` Key *string `toml:"key_secret"` Environment *string `toml:"environment"` }
func (*PyroscopeConfig) Validate ¶ added in v1.23.0
func (c *PyroscopeConfig) Validate() error
Validate checks that the pyroscope config is valid, which means that server url, environment and key are set and non-empty, but only if pyroscope is enabled
type ReorgConfig ¶ added in v1.30.3
type ReorgConfig struct { Enabled bool `toml:"enabled,omitempty"` Depth int `toml:"depth,omitempty"` DelayCreate blockchain.StrDuration `toml:"delay_create,omitempty"` // Delay before creating, expressed in Go duration format (e.g., "1m", "30s") }
type SethConfig ¶ added in v1.28.7
type TestConfig ¶ added in v1.28.8
type TestConfig struct { ChainlinkImage *ChainlinkImageConfig `toml:"ChainlinkImage"` ChainlinkUpgradeImage *ChainlinkImageConfig `toml:"ChainlinkUpgradeImage"` Logging *LoggingConfig `toml:"Logging"` Network *NetworkConfig `toml:"Network"` Pyroscope *PyroscopeConfig `toml:"Pyroscope"` PrivateEthereumNetwork *EthereumNetworkConfig `toml:"PrivateEthereumNetwork"` WaspConfig *WaspAutoBuildConfig `toml:"WaspAutoBuild"` Seth *seth.Config `toml:"Seth"` NodeConfig *NodeConfig `toml:"NodeConfig"` }
func (TestConfig) GetChainlinkImageConfig ¶ added in v1.28.8
func (c TestConfig) GetChainlinkImageConfig() *ChainlinkImageConfig
func (*TestConfig) GetLoggingConfig ¶ added in v1.28.8
func (c *TestConfig) GetLoggingConfig() *LoggingConfig
func (TestConfig) GetNetworkConfig ¶ added in v1.28.8
func (c TestConfig) GetNetworkConfig() *NetworkConfig
func (*TestConfig) GetNodeConfig ¶ added in v1.28.12
func (c *TestConfig) GetNodeConfig() *NodeConfig
func (TestConfig) GetPrivateEthereumNetworkConfig ¶ added in v1.28.8
func (c TestConfig) GetPrivateEthereumNetworkConfig() *EthereumNetworkConfig
func (TestConfig) GetPyroscopeConfig ¶ added in v1.28.8
func (c TestConfig) GetPyroscopeConfig() *PyroscopeConfig
type WaspAutoBuildConfig ¶ added in v1.23.6
type WaspAutoBuildConfig struct { Namespace *string `toml:"namespace"` RepoImageVersionURI *string `toml:"repo_image_version_uri"` TestBinaryName *string `toml:"test_binary_name"` TestName *string `toml:"test_name"` TestTimeout *string `toml:"test_timeout"` KeepJobs bool `toml:"keep_jobs"` WaspLogLevel *string `toml:"wasp_log_level"` WaspJobs *string `toml:"wasp_jobs"` UpdateImage bool `toml:"update_image"` }
func (*WaspAutoBuildConfig) Validate ¶ added in v1.23.6
func (c *WaspAutoBuildConfig) Validate() error