Documentation
¶
Overview ¶
Copyright 2022 Nethermind
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Nethermind ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Nethermind ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Nethermind ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Nethermind ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func CleanDockerCompose(dockerComposePath string) error
- func CleanEnvFile(envFilePath string) error
- func CleanGenerated(genPath string) error
- func ComposeFile(gd *GenData, at io.Writer) error
- func EnvFile(gd *GenData, at io.Writer) error
- type ComposeData
- type ConfigConsensus
- type Consensus
- type CustomConfigsSources
- type CustomNetworkConfigsData
- type DependsOn
- type DockerComposeData
- type EnvData
- type Execution
- type GenData
- type Logging
- type Mevboost
- type Networks
- type Options
- type Sedge
- type Services
- type Validator
- type ValidatorBlocker
- type ValidatorImportDependsOn
Constants ¶
This section is empty.
Variables ¶
var ErrConsensusClientNotValid = errors.New("invalid consensus client")
ErrConsensusClientNotValid is returned when the consensus client is not valid
var ErrEmptyData = errors.New("data is nil")
ErrEmptyData is returned when the data is nil
var ErrExecutionClientNotValid = errors.New("invalid execution client")
ErrExecutionClientNotValid is returned when the execution client is not valid
var ErrTemplateNotFound = errors.New("template not found")
ErrTemplateNotFound is returned when the template is not found
var ErrUnableToGetClientsInfo = errors.New("unable to get clients information")
ErrUnableToGetClientsInfo is returned when the client information cannot be retrieved
var ErrValidatorClientNotValid = errors.New("invalid validator client")
ErrValidatorClientNotValid is returned when the validator client is not valid
Functions ¶
func CleanDockerCompose ¶
CleanDockerCompose This functions is responsible for the process of cleaning a generated docker compose script. params :- a. dockerComposePath string Path of the docker compose file to clean returns :- a. error Error if any
func CleanEnvFile ¶
CleanEnvFile This functions is resposible for the process of cleaning a generated `.env` file. It removes the duplicated env var in the file keeping only the latest apparititon of it. params :- a. envFilePath string Path of the generated `.env` file returns :- a. error Error if any
func CleanGenerated ¶
CleanGenerated This functions handles the process of cleaning the generation results files params :- a. gr GenerationResults The generations results to be cleaned returns:- a. error Error if any
func ComposeFile ¶
ComposeFile generates a docker-compose file with the provided GenData
Types ¶
type ComposeData ¶
type ComposeData struct {
Version string `yaml:"version,omitempty"`
Services *Services `yaml:"services"`
Networks *Networks `yaml:"networks,omitempty"`
}
func ParseCompose ¶
func ParseCompose(path string) (*ComposeData, error)
ParseCompose parse a Sedge valid docker-compose script
type ConfigConsensus ¶
type Consensus ¶
type Consensus struct {
StopGracePeriod string `yaml:"stop_grace_period"`
ContainerName string `yaml:"container_name"`
Restart string `yaml:"restart"`
Image string `yaml:"image"`
Networks []string `yaml:"networks"`
Volumes []string `yaml:"volumes"`
Ports []string `yaml:"ports"`
Expose []int `yaml:"expose"`
Command []string `yaml:"command"`
Logging *Logging `yaml:"logging,omitempty"`
}
type CustomConfigsSources ¶
type CustomNetworkConfigsData ¶
type CustomNetworkConfigsData struct {
ChainSpecPath string
NetworkConfigPath string
GenesisPath string
DeployBlockPath string
}
func CustomNetworkConfigs ¶
func CustomNetworkConfigs(generationPath, network string, sources CustomConfigsSources) (CustomNetworkConfigsData, error)
type DependsOn ¶
type DependsOn struct {
ValidatorImport *ValidatorImportDependsOn `yaml:"validator-import"`
}
type DockerComposeData ¶
type DockerComposeData struct {
Services []string
Network string
XeeVersion bool
Mev bool
MevBoostOnValidator bool
MevPort uint16
MevImage string
MevBoostEndpoint string
CheckpointSyncUrl string
FeeRecipient string
ElDiscoveryPort uint16
ElMetricsPort uint16
ElApiPort uint16
ElAuthPort uint16
ElWsPort uint16
ClDiscoveryPort uint16
ClMetricsPort uint16
ClApiPort uint16
ClAdditionalApiPort uint16
VlMetricsPort uint16
FallbackELUrls []string
ElExtraFlags []string
ClExtraFlags []string
VlExtraFlags []string
ECBootnodes string
CCBootnodes string
CCBootnodesList []string
MapAllPorts bool
SplittedNetwork bool
ClCheckpointSyncUrl bool
LoggingDriver string
CustomConsensusConfigs bool
CustomNetwork bool
CustomChainSpecPath string
CustomNetworkConfigPath string
CustomGenesisPath string
CustomDeployBlock bool
CustomDeployBlockPath string // Needed for lighthouse
VLStartGracePeriod uint
UID int // Needed for teku
GID int // Needed for teku
ContainerTag string
}
DockerComposeData : Struct Data object to be applied to docker-compose script
func (DockerComposeData) WithConsensusClient ¶
func (d DockerComposeData) WithConsensusClient() bool
WithConsensusClient returns true if the consensus client is set
func (DockerComposeData) WithValidatorClient ¶
func (d DockerComposeData) WithValidatorClient() bool
WithValidatorClient returns true if the validator client is set
type EnvData ¶
type EnvData struct {
Services []string
Mev bool
ElImage string
ElDataDir string
CcImage string
CcDataDir string
VlImage string
VlDataDir string
ExecutionApiURL string
ExecutionAuthURL string
ConsensusApiURL string
ConsensusAdditionalApiURL string
FeeRecipient string
JWTSecretPath string
ExecutionEngineName string
ConsensusClientName string
KeystoreDir string
Graffiti string
RelayURLs string
CheckpointSyncUrl string
}
EnvData : Struct Data object to be applied to the docker-compose script environment (.env) template
func (EnvData) WithMevBoostClient ¶
WithMevBoostClient returns true if the Mev-Boost client is set
type Execution ¶
type Execution struct {
StopGracePeriod string `yaml:"stop_grace_period"`
ContainerName string `yaml:"container_name"`
Restart string `yaml:"restart"`
Image string `yaml:"image"`
Networks []string `yaml:"networks"`
Volumes []string `yaml:"volumes"`
Ports []string `yaml:"ports"`
Expose []int `yaml:"expose"`
Command []string `yaml:"command"`
Logging *Logging `yaml:"logging,omitempty"`
}
type GenData ¶
type GenData struct {
Services []string
ExecutionClient *clients.Client
ConsensusClient *clients.Client
ValidatorClient *clients.Client
Network string
CheckpointSyncUrl string
FeeRecipient string
JWTSecretPath string
FallbackELUrls []string
ElExtraFlags []string
ClExtraFlags []string
VlExtraFlags []string
MapAllPorts bool
Mev bool
RelayURLs []string
MevImage string
MevBoostService bool
MevBoostEndpoint string
MevBoostOnValidator bool
Ports map[string]uint16
Graffiti string
LoggingDriver string
ECBootnodes []string
CCBootnodes []string
CustomChainSpecPath string
CustomNetworkConfigPath string
CustomGenesisPath string
CustomDeployBlock string
CustomDeployBlockPath string
VLStartGracePeriod uint
ExecutionApiUrl string
ExecutionAuthUrl string
ConsensusApiUrl string
ContainerTag string
LatestVersion bool
}
GenData : Struct Data object for script's generation
type Services ¶
type Services struct {
Execution *Execution `yaml:"execution,omitempty"`
Mevboost *Mevboost `yaml:"mev-boost,omitempty"`
Consensus *Consensus `yaml:"consensus,omitempty"`
ValidatorBlocker *ValidatorBlocker `yaml:"validator-blocker,omitempty"`
Validator *Validator `yaml:"validator,omitempty"`
ConfigConsensus *ConfigConsensus `yaml:"config_consensus,omitempty"`
}
type Validator ¶
type Validator struct {
ContainerName string `yaml:"container_name"`
Image string `yaml:"image"`
DependsOn *DependsOn `yaml:"depends_on"`
Networks []string `yaml:"networks"`
Ports []string `yaml:"ports"`
Volumes []string `yaml:"volumes"`
Command []string `yaml:"command"`
Logging *Logging `yaml:"logging,omitempty"`
}
type ValidatorBlocker ¶
type ValidatorImportDependsOn ¶
type ValidatorImportDependsOn struct {
Condition string `yaml:"condition"`
}