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 ConsensusSync
- type CustomConfigsSources
- type CustomNetworkConfigsData
- type DependsOn
- type DistributedValidator
- 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 ErrDistributedValidatorClientNotValid = errors.New("invalid distributed validator client")
ErrDistributedValidatorClientNotValid is returned when the distributed validator 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 ¶ added in v0.3.0
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 ¶ added in v0.3.0
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 ¶ added in v0.3.0
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 ¶ added in v1.0.0
ComposeFile generates a docker-compose file with the provided GenData
Types ¶
type ComposeData ¶ added in v1.0.0
type ComposeData struct {
Version string `yaml:"version,omitempty"`
Services *Services `yaml:"services"`
Networks *Networks `yaml:"networks,omitempty"`
}
func ParseCompose ¶ added in v1.0.0
func ParseCompose(path string) (*ComposeData, error)
ParseCompose parse a Sedge valid docker-compose script
type ConfigConsensus ¶ added in v1.0.0
type Consensus ¶ added in v1.0.0
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 ConsensusSync ¶ added in v1.6.0
type ConsensusSync 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 ¶ added in v1.0.0
type CustomNetworkConfigsData ¶ added in v1.0.0
type CustomNetworkConfigsData struct {
ChainSpecPath string
NetworkConfigPath string
GenesisPath string
DeployBlockPath string
}
func CustomNetworkConfigs ¶ added in v1.0.0
func CustomNetworkConfigs(generationPath, network string, sources CustomConfigsSources) (CustomNetworkConfigsData, error)
type DependsOn ¶ added in v1.0.0
type DependsOn struct {
ValidatorImport *ValidatorImportDependsOn `yaml:"validator-import"`
}
type DistributedValidator ¶ added in v1.8.0
type DistributedValidator struct {
ContainerName string `yaml:"container_name"`
Image string `yaml:"image"`
DependsOn []string `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 DockerComposeData ¶
type DockerComposeData struct {
Services []string
Network string
Distributed bool
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
ElOPDiscoveryPort uint16
ElOPMetricsPort uint16
ElOPApiPort uint16
ElOPAuthPort uint16
ClDiscoveryPort uint16
ClMetricsPort uint16
ClApiPort uint16
ClAdditionalApiPort uint16
VlMetricsPort uint16
FallbackELUrls []string
ElExtraFlags []string
ElOPExtraFlags []string
OPExtraFlags []string
NetworkPrefix string
ClExtraFlags []string
VlExtraFlags []string
DvExtraFlags []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
DVDiscoveryPort uint16
DVMetricsPort uint16
DVApiPort uint16
ConsensusApiURL string
}
DockerComposeData : Struct Data object to be applied to docker-compose script
func (DockerComposeData) WithConsensusClient ¶ added in v1.0.0
func (d DockerComposeData) WithConsensusClient() bool
WithConsensusClient returns true if the consensus client is set
func (DockerComposeData) WithOptimismClient ¶ added in v1.6.0
func (d DockerComposeData) WithOptimismClient() bool
WithOptimismClient returns true if the optimism client is set
func (DockerComposeData) WithValidatorClient ¶ added in v1.0.0
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
ElOpImage string
ElDataDir string
CcImage string
CcDataDir string
VlImage string
VlDataDir string
ExecutionApiURL string
ExecutionAuthURL string
ConsensusApiURL string
ConsensusAdditionalApiURL string
Distributed bool
FeeRecipient string
JWTSecretPath string
ExecutionEngineName string
ConsensusClientName string
KeystoreDir string
Graffiti string
RelayURLs string
CheckpointSyncUrl string
DistributedValidatorApiUrl string
DvDataDir string
DvImage string
ExecutionOPApiURL string
JWTOPSecretPath string
OPImageVersion string
ElOPAuthPort uint16
OpSequencerHttp string
RethNetwork string
}
EnvData : Struct Data object to be applied to the docker-compose script environment (.env) template
func (EnvData) WithDistributedValidatorClient ¶ added in v1.8.0
WithDistributedValidatorClient returns true if the DistributedValidator client is set
func (EnvData) WithMevBoostClient ¶ added in v1.0.0
WithMevBoostClient returns true if the Mev-Boost client is set
type Execution ¶ added in v1.0.0
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 ¶ added in v1.0.0
type GenData struct {
Services []string
ExecutionClient *clients.Client
ConsensusClient *clients.Client
ValidatorClient *clients.Client
DistributedValidatorClient *clients.Client
Distributed bool
ExecutionOPClient *clients.Client
OptimismClient *clients.Client
Network string
CheckpointSyncUrl string
FeeRecipient string
JWTSecretPath string
FallbackELUrls []string
ElExtraFlags []string
ClExtraFlags []string
VlExtraFlags []string
DvExtraFlags []string
ElOpExtraFlags []string
OpExtraFlags []string
IsBase bool
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
JWTSecretOP string
}
GenData : Struct Data object for script's generation
type Services ¶ added in v1.0.0
type Services struct {
Execution *Execution `yaml:"execution,omitempty"`
Mevboost *Mevboost `yaml:"mev-boost,omitempty"`
Consensus *Consensus `yaml:"consensus,omitempty"`
ConsensusSync *ConsensusSync `yaml:"consensus-sync,omitempty"`
ValidatorBlocker *ValidatorBlocker `yaml:"validator-blocker,omitempty"`
Validator *Validator `yaml:"validator,omitempty"`
ConfigConsensus *ConfigConsensus `yaml:"config_consensus,omitempty"`
DistributedValidator *DistributedValidator `yaml:"dv,omitempty"`
}
type Validator ¶ added in v1.0.0
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 ¶ added in v1.0.0
type ValidatorImportDependsOn ¶ added in v1.0.0
type ValidatorImportDependsOn struct {
Condition string `yaml:"condition"`
}