Documentation
¶
Index ¶
- Variables
- func ParseAddress(address, defaultHost, defaultPort string) (host, port string)
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetBeaconNodeAddress() string
- func (x *Config) GetContributoorDirectory() string
- func (x *Config) GetDockerNetwork() string
- func (x *Config) GetHealthCheckAddress() string
- func (c *Config) GetHealthCheckHostPort() (host, port string)
- func (x *Config) GetLogLevel() string
- func (x *Config) GetMetricsAddress() string
- func (c *Config) GetMetricsHostPort() (host, port string)
- func (x *Config) GetNetworkName() NetworkName
- func (x *Config) GetOutputServer() *OutputServer
- func (x *Config) GetPprofAddress() string
- func (c *Config) GetPprofHostPort() (host, port string)
- func (x *Config) GetRunMethod() RunMethod
- func (x *Config) GetVersion() string
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (c *Config) SetBeaconNodeAddress(address string)
- func (c *Config) SetContributoorDirectory(dir string)
- func (c *Config) SetHealthCheckAddress(address string)
- func (c *Config) SetLogLevel(level string)
- func (c *Config) SetMetricsAddress(address string)
- func (c *Config) SetNetwork(network string)
- func (c *Config) SetOutputServerAddress(address string)
- func (c *Config) SetOutputServerCredentials(creds string)
- func (c *Config) SetOutputServerTLS(useTLS bool)
- func (x *Config) String() string
- func (m *Config) Validate() error
- func (m *Config) ValidateAll() error
- type ConfigMultiError
- type ConfigValidationError
- type NetworkName
- func (NetworkName) Descriptor() protoreflect.EnumDescriptor
- func (n NetworkName) DisplayName() string
- func (x NetworkName) Enum() *NetworkName
- func (NetworkName) EnumDescriptor() ([]byte, []int)deprecated
- func (x NetworkName) Number() protoreflect.EnumNumber
- func (x NetworkName) String() string
- func (NetworkName) Type() protoreflect.EnumType
- type OutputServer
- func (*OutputServer) Descriptor() ([]byte, []int)deprecated
- func (x *OutputServer) GetAddress() string
- func (x *OutputServer) GetCredentials() string
- func (x *OutputServer) GetTls() bool
- func (*OutputServer) ProtoMessage()
- func (x *OutputServer) ProtoReflect() protoreflect.Message
- func (x *OutputServer) Reset()
- func (x *OutputServer) String() string
- func (m *OutputServer) Validate() error
- func (m *OutputServer) ValidateAll() error
- type OutputServerMultiError
- type OutputServerValidationError
- func (e OutputServerValidationError) Cause() error
- func (e OutputServerValidationError) Error() string
- func (e OutputServerValidationError) ErrorName() string
- func (e OutputServerValidationError) Field() string
- func (e OutputServerValidationError) Key() bool
- func (e OutputServerValidationError) Reason() string
- type RunMethod
- func (RunMethod) Descriptor() protoreflect.EnumDescriptor
- func (r RunMethod) DisplayName() string
- func (x RunMethod) Enum() *RunMethod
- func (RunMethod) EnumDescriptor() ([]byte, []int)deprecated
- func (x RunMethod) Number() protoreflect.EnumNumber
- func (x RunMethod) String() string
- func (RunMethod) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( RunMethod_name = map[int32]string{ 0: "RUN_METHOD_UNSPECIFIED", 1: "RUN_METHOD_DOCKER", 2: "RUN_METHOD_SYSTEMD", 3: "RUN_METHOD_BINARY", } RunMethod_value = map[string]int32{ "RUN_METHOD_UNSPECIFIED": 0, "RUN_METHOD_DOCKER": 1, "RUN_METHOD_SYSTEMD": 2, "RUN_METHOD_BINARY": 3, } )
Enum value maps for RunMethod.
var ( NetworkName_name = map[int32]string{ 0: "NETWORK_NAME_UNSPECIFIED", 1: "NETWORK_NAME_MAINNET", 2: "NETWORK_NAME_SEPOLIA", 3: "NETWORK_NAME_HOLESKY", } NetworkName_value = map[string]int32{ "NETWORK_NAME_UNSPECIFIED": 0, "NETWORK_NAME_MAINNET": 1, "NETWORK_NAME_SEPOLIA": 2, "NETWORK_NAME_HOLESKY": 3, } )
Enum value maps for NetworkName.
var File_config_v1_config_proto protoreflect.FileDescriptor
Functions ¶
func ParseAddress ¶
ParseAddress parses an address string into host and port components. If the address is empty, returns the default host and port. If only port is specified (":8080"), returns default host and the specified port.
Types ¶
type Config ¶
type Config struct {
// LogLevel is the log level to use.
LogLevel string `protobuf:"bytes,1,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"`
// Version of the contributoor service running.
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
// Directory where contributoor houses its configuration and related data.
ContributoorDirectory string `protobuf:"bytes,3,opt,name=contributoor_directory,json=contributoorDirectory,proto3" json:"contributoor_directory,omitempty"`
// RunMethod is the method used to run the contributoorservice.
RunMethod RunMethod `protobuf:"varint,4,opt,name=run_method,json=runMethod,proto3,enum=config.v1.RunMethod" json:"run_method,omitempty"`
// NetworkName is the name of the network the beacon node is running on.
NetworkName NetworkName `protobuf:"varint,5,opt,name=network_name,json=networkName,proto3,enum=config.v1.NetworkName" json:"network_name,omitempty"`
// BeaconNodeAddress is the address of the beacon node.
BeaconNodeAddress string `protobuf:"bytes,6,opt,name=beacon_node_address,json=beaconNodeAddress,proto3" json:"beacon_node_address,omitempty"`
// MetricsAddress is the (optional) address to serve metrics on.
MetricsAddress string `protobuf:"bytes,7,opt,name=metrics_address,json=metricsAddress,proto3" json:"metrics_address,omitempty"`
// PprofAddress is the (optional) address to serve pprof on.
PprofAddress string `protobuf:"bytes,8,opt,name=pprof_address,json=pprofAddress,proto3" json:"pprof_address,omitempty"`
// OutputServer is the configuration for the output server.
OutputServer *OutputServer `protobuf:"bytes,9,opt,name=output_server,json=outputServer,proto3" json:"output_server,omitempty"`
// DockerNetwork is the name of the docker network to use.
DockerNetwork string `protobuf:"bytes,10,opt,name=docker_network,json=dockerNetwork,proto3" json:"docker_network,omitempty"`
// HealthCheckAddress is the (optional) address to serve healthcheck on.
HealthCheckAddress string `protobuf:"bytes,11,opt,name=health_check_address,json=healthCheckAddress,proto3" json:"health_check_address,omitempty"`
// contains filtered or unexported fields
}
Config represents the main configuration for the contributoor service.
func NewConfigFromPath ¶
NewConfigFromPath loads a config from a YAML file and validates it.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns a new default config.
func (*Config) Descriptor
deprecated
func (*Config) GetBeaconNodeAddress ¶
func (*Config) GetContributoorDirectory ¶
func (*Config) GetDockerNetwork ¶
func (*Config) GetHealthCheckAddress ¶ added in v0.0.48
func (*Config) GetHealthCheckHostPort ¶ added in v0.0.48
GetHealthCheckHostPort returns the health check host and port. If HealthCheckAddress is not set, returns empty strings.
func (*Config) GetLogLevel ¶
func (*Config) GetMetricsAddress ¶
func (*Config) GetMetricsHostPort ¶
GetMetricsHostPort returns the metrics host and port. If MetricsAddress is not set, returns default values.
func (*Config) GetNetworkName ¶
func (x *Config) GetNetworkName() NetworkName
func (*Config) GetOutputServer ¶
func (x *Config) GetOutputServer() *OutputServer
func (*Config) GetPprofAddress ¶
func (*Config) GetPprofHostPort ¶
GetPprofHostPort returns the pprof host and port. If PprofAddress is not set, returns empty strings.
func (*Config) GetRunMethod ¶
func (*Config) GetVersion ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) SetBeaconNodeAddress ¶
SetBeaconNodeAddress sets the beacon node address.
func (*Config) SetContributoorDirectory ¶
SetContributoorDirectory sets the contributoor directory.
func (*Config) SetHealthCheckAddress ¶ added in v0.0.48
SetHealthCheckAddress sets the health check address.
func (*Config) SetLogLevel ¶
SetLogLevel sets the log level.
func (*Config) SetMetricsAddress ¶
SetMetricsAddress sets the metrics address.
func (*Config) SetNetwork ¶
SetNetwork sets the network name.
func (*Config) SetOutputServerAddress ¶
SetOutputServerAddress sets the output server address.
func (*Config) SetOutputServerCredentials ¶
SetOutputServerCredentials sets the output server credentials.
func (*Config) SetOutputServerTLS ¶
SetOutputServerTLS sets whether to use TLS for the output server.
func (*Config) Validate ¶
Validate checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Config) ValidateAll ¶
ValidateAll checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigMultiError, or nil if none found.
type ConfigMultiError ¶
type ConfigMultiError []error
ConfigMultiError is an error wrapping multiple validation errors returned by Config.ValidateAll() if the designated constraints aren't met.
func (ConfigMultiError) AllErrors ¶
func (m ConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigMultiError) Error ¶
func (m ConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigValidationError ¶
type ConfigValidationError struct {
// contains filtered or unexported fields
}
ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.
func (ConfigValidationError) Cause ¶
func (e ConfigValidationError) Cause() error
Cause function returns cause value.
func (ConfigValidationError) Error ¶
func (e ConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigValidationError) ErrorName ¶
func (e ConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigValidationError) Field ¶
func (e ConfigValidationError) Field() string
Field function returns field value.
func (ConfigValidationError) Key ¶
func (e ConfigValidationError) Key() bool
Key function returns key value.
func (ConfigValidationError) Reason ¶
func (e ConfigValidationError) Reason() string
Reason function returns reason value.
type NetworkName ¶
type NetworkName int32
NetworkName defines which Ethereum network the beacon node is running on.
const ( // Invalid, should not be used. NetworkName_NETWORK_NAME_UNSPECIFIED NetworkName = 0 // Ethereum mainnet. NetworkName_NETWORK_NAME_MAINNET NetworkName = 1 // Sepolia testnet. NetworkName_NETWORK_NAME_SEPOLIA NetworkName = 2 // Holesky testnet. NetworkName_NETWORK_NAME_HOLESKY NetworkName = 3 )
func (NetworkName) Descriptor ¶
func (NetworkName) Descriptor() protoreflect.EnumDescriptor
func (NetworkName) DisplayName ¶
func (n NetworkName) DisplayName() string
DisplayName returns the display name of the network.
func (NetworkName) Enum ¶
func (x NetworkName) Enum() *NetworkName
func (NetworkName) EnumDescriptor
deprecated
func (NetworkName) EnumDescriptor() ([]byte, []int)
Deprecated: Use NetworkName.Descriptor instead.
func (NetworkName) Number ¶
func (x NetworkName) Number() protoreflect.EnumNumber
func (NetworkName) String ¶
func (x NetworkName) String() string
func (NetworkName) Type ¶
func (NetworkName) Type() protoreflect.EnumType
type OutputServer ¶
type OutputServer struct {
// Address of the output server, eg: where the Xatu output server is running.
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// Optional credentials for authentication, this is a base64 encoded string in the format of "username:password".
Credentials string `protobuf:"bytes,2,opt,name=credentials,proto3" json:"credentials,omitempty"`
// TLS is whether to use TLS for the output server.
Tls bool `protobuf:"varint,3,opt,name=tls,proto3" json:"tls,omitempty"`
// contains filtered or unexported fields
}
OutputServer represents configuration for the output server.
func (*OutputServer) Descriptor
deprecated
func (*OutputServer) Descriptor() ([]byte, []int)
Deprecated: Use OutputServer.ProtoReflect.Descriptor instead.
func (*OutputServer) GetAddress ¶
func (x *OutputServer) GetAddress() string
func (*OutputServer) GetCredentials ¶
func (x *OutputServer) GetCredentials() string
func (*OutputServer) GetTls ¶
func (x *OutputServer) GetTls() bool
func (*OutputServer) ProtoMessage ¶
func (*OutputServer) ProtoMessage()
func (*OutputServer) ProtoReflect ¶
func (x *OutputServer) ProtoReflect() protoreflect.Message
func (*OutputServer) Reset ¶
func (x *OutputServer) Reset()
func (*OutputServer) String ¶
func (x *OutputServer) String() string
func (*OutputServer) Validate ¶
func (m *OutputServer) Validate() error
Validate checks the field values on OutputServer with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*OutputServer) ValidateAll ¶
func (m *OutputServer) ValidateAll() error
ValidateAll checks the field values on OutputServer with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in OutputServerMultiError, or nil if none found.
type OutputServerMultiError ¶
type OutputServerMultiError []error
OutputServerMultiError is an error wrapping multiple validation errors returned by OutputServer.ValidateAll() if the designated constraints aren't met.
func (OutputServerMultiError) AllErrors ¶
func (m OutputServerMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (OutputServerMultiError) Error ¶
func (m OutputServerMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type OutputServerValidationError ¶
type OutputServerValidationError struct {
// contains filtered or unexported fields
}
OutputServerValidationError is the validation error returned by OutputServer.Validate if the designated constraints aren't met.
func (OutputServerValidationError) Cause ¶
func (e OutputServerValidationError) Cause() error
Cause function returns cause value.
func (OutputServerValidationError) Error ¶
func (e OutputServerValidationError) Error() string
Error satisfies the builtin error interface
func (OutputServerValidationError) ErrorName ¶
func (e OutputServerValidationError) ErrorName() string
ErrorName returns error name.
func (OutputServerValidationError) Field ¶
func (e OutputServerValidationError) Field() string
Field function returns field value.
func (OutputServerValidationError) Key ¶
func (e OutputServerValidationError) Key() bool
Key function returns key value.
func (OutputServerValidationError) Reason ¶
func (e OutputServerValidationError) Reason() string
Reason function returns reason value.
type RunMethod ¶
type RunMethod int32
RunMethod defines how the service is run.
const ( // Invalid, should not be used. RunMethod_RUN_METHOD_UNSPECIFIED RunMethod = 0 // Run using docker. RunMethod_RUN_METHOD_DOCKER RunMethod = 1 // Run using systemd/launchd service manager. RunMethod_RUN_METHOD_SYSTEMD RunMethod = 2 // Run directly as a binary. RunMethod_RUN_METHOD_BINARY RunMethod = 3 )
func (RunMethod) Descriptor ¶
func (RunMethod) Descriptor() protoreflect.EnumDescriptor
func (RunMethod) DisplayName ¶
DisplayName returns the display name of the run method.
func (RunMethod) EnumDescriptor
deprecated
func (RunMethod) Number ¶
func (x RunMethod) Number() protoreflect.EnumNumber
func (RunMethod) Type ¶
func (RunMethod) Type() protoreflect.EnumType