configs

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

/configs

Configuration file templates or default configs.

Put your confd or consul-template template files here.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

Constants

View Source
const (
	OnPremiseExecutionURL = "http://execution"
	OnPremiseConsensusURL = "http://consensus"
)
View Source
const (
	ReadingInstructionError           = "failed to read instructions from file %s"
	IncorrectClientError              = "" /* 127-byte string literal not displayed */
	ClosingFileError                  = "failed to close file %s"
	ScriptIsNotRunningError           = "services of docker-compose script provided are not running. Error: %v"
	GettingLogsError                  = "failed to get logs for services %s. Error: %v"
	DockerComposePsReturnedEmptyError = "'docker compose ps --services' returned empty string"
	InvalidVolumePathError            = "invalid path provided: %s. If you intended to pass a host directory, use absolute path"
	ZipError                          = "all lists must have the same size"
	CommandError                      = "command '%s' throws error: %v"
	DistroInfoError                   = "failed to get linux distribution info. Error: %v"
	EmptyClientMapError               = "is not possible to select a random element from an empty collection"
	NoSupportedClientsError           = "" /* 210-byte string literal not displayed */
	NetworkValidationFailedError      = "'network' flag validation failed. Error: %v"
	UnknownNetworkError               = "unknown network \"%s\". Please provide correct network name. Use 'networks' command to see the list of supported networks"
	GenerateJWTSecretError            = "JWT secret generation failed. Error: %v"
	GetPWDError                       = "something failed trying to get current working directory. Error: %v"
	EmptyFeeRecipientError            = "you should provide an Ethereum address for the Fee Recipient"
	KeystorePasswordError             = "keystore password must have more than 8 characters"
	PortOccupationError               = "port occupation check failed. Error: %v"
	DefaultPortInvalidError           = "default %s can not be zero"
	PrintFileError                    = "error printing file content: %v"
	CleaningEnvFileError              = "error cleaning env file: %v"
	CleaningDCFileError               = "error cleaning docker compose file: %v"
	PassphraseReadFileError           = "error reading passphrase file: %v"
	MnemonicReadFileError             = "error reading passphrase file: %v"
	MnemonicGenerationError           = "error creating mnemonic: %v"
	KeyEntryGenerationError           = "error generating keystore: could not read sufficient secure random bytes"
	AESParamsCreationError            = "failed to create AES128CTR params: %w"
	SecretEncryptionError             = "failed to encrypt secret: %w"
	KeystoreOutputExistingError       = "output folder for keystores already exists"
	KeystoreGenerationError           = "error generating keystores: %v"
	KeystoreDerivationError           = "keystore %s cannot be derived, continuing to next keystore"
	KeystoreExistingInWalletError     = "keystore with name \"%s\" already exists"
	KeystoreImportingError            = "failed to import keystore with pubkey %s into output wallet: %v"
	InvalidMnemonicError              = "mnemonic is not valid"
	BadMnemonicError                  = "bad mnemonic: %v"
	ForkVersionDecodeError            = "cannot decode fork version: %v"
	DepositFileWriteError             = "cannot write deposit file: %v"
	KeystoreSecretKeyCreationError    = "failed to create validator private key for path %q: %v"
	WithdrawalSecretKeyCreationError  = "failed to create withdrawal private key for path %q: %v"
	KeystoreSecretKeyConvertionError  = "cannot convert validator priv key: %v"
	DepositDataEncodingError          = "could not encode deposit data to json: %v"
	InvalidLoggingFlag                = "bad logging flag: %v"
	CannotGenerateSecret              = "cannot generate 32 bytes long secret"
	ShowMnemonicError                 = "error displaying mnemonic: %v"
	InvalidFilePathOrUrl              = "invalid filepath or url: %s"
	CannotGetUrlContent               = "cannot get url %s content: %v"
	CannotReadFileContent             = "cannot read file %s content: %v"
	ErrorCheckingFile                 = "error checking file %s: %v"
	DestFileAlreadyExist              = "destiny file %s already exist"
	ErrorCreatingFile                 = "error creating file %s: %v"
	ErrorDownloadingFile              = "error downloading file from %s: %v"
	ErrorCopyingFile                  = "error copying file from %s: %v"
	ErrorWritingDeployBlockFile       = "error writing custom deploy block file %s: %v"
	InvalidUrlFlagError               = "invalid %s url %s. URL must be in the format http(s)://<host>:<port>/<api>/<endpoint>/... or http://<host>/<api>/<endpoint>/"
	InvalidEnodeError                 = "invalid enode %s. Bootnode must be in the format enode://<node id>@<host>:<port>"
	InvalidEnrError                   = "invalid enr %s. ENR must be in the format enr:<base64 encoded string>"
	InvalidService                    = "provided service %s is invalid"
	SetupContainersErr                = "error setting up service containers: %w"
	StartingContainersErr             = "error starting service containers: %w"
	ReadingYmlErr                     = "error reading yml file: %w"
	ParsingYmlErr                     = "error parsing yml file, it seems is not a valid docker-compose script: %w"
	ServicesNotFoundErr               = "services not found in the docker-compose script"
	InvalidComposeErr                 = "provided docker-compose script is invalid: %w"
	ErrDuplicatedBootNode             = "duplicated boot node"
	ErrGraffitiLength                 = "graffiti must have 16 characters at most. Provided graffiti %s has %d characters"
	ErrCMDArgsNotSupported            = "command %s does not support arguments. Please use flags instead"
)

All the strings that are needed for error logging.

View Source
const (
	DefaultMevBoostEndpoint       = "http://mev-boost"
	DefaultEnvFileName            = ".env"
	CheckingDependencies          = "Checking dependencies: %s"
	DependenciesPending           = "pending dependencies: %s"
	DependenciesOK                = "All dependencies are installed on host machine"
	GeneratingDockerComposeScript = "Generating docker-compose script for current selection of clients"
	GeneratingEnvFile             = "Generating environment file for current selection of clients"
	GeneratedDockerComposeScript  = "Generated docker-compose script for current selection of clients"
	GeneratedEnvFile              = "Generated environment file for current selection of clients"
	CleaningGeneratedFiles        = "Cleaning generated docker-compose and environment files"
	CleanedGeneratedFiles         = "Cleaned generated files"
	GenerationEnd                 = "Generation of files successfully, happy staking! You can use now 'sedge run' to start the setup."
	Exiting                       = "Exiting..."
	InstructionsFor               = "Instructions for %s"
	OSNotSupported                = "installation not supported for %s"
	ProvideClients                = "Please provide both execution client and consensus client"
	CreatedFile                   = "Created file %s"
	DefaultSedgeDataFolderName    = "sedge-data"
	ClientNotSupported            = "client %s is not supported. Please use 'clients' command to see the list of supported clients"
	PrintingFile                  = "File %s:"
	SupportedClients              = "Supported clients of type %s: %v"
	ConfigClientsMsg              = "Provided clients of type %s in configuration file: %v"
	RunningDockerCompose          = "Running docker-compose script"
	Component                     = "component"
	RunningCommand                = "Running command: %s"
	UnableToProceed               = "Unable to proceed. Please check the logs for more details"
	CheckingDockerEngine          = "Checking if docker engine is on"
	DepositCLIDockerImageUrl      = "nethermindeth/staking-deposit-cli" //"github.com/ethereum/staking-deposit-cli"
	DepositCLIDockerImageName     = "nethermindeth/staking-deposit-cli" //"deposit-cli:local"
	GeneratingKeystores           = "Generating keystores..."
	GeneratingKeystoresLegacy     = "Generating keystore folder"
	KeystoresGenerated            = "Keystores generated successfully"
	GeneratingDepositData         = "Generating deposit data..."
	DepositDataGenerated          = "Deposit data generated successfully"
	KeysFoundAt                   = "If everything went well, your keys can be found at: %s"
	ImageNotFoundBuilding         = "Image %s not found, building it"
	ImageNotFoundPulling          = "Image %s not found, pulling it"

	ReviewKeystorePath = "" /* 269-byte string literal not displayed */
	NodesSynced        = "Execution and Consensus clients are synced, proceeding to start validator node"
	RemoteNodeNeeded   = `` /* 412-byte string literal not displayed */

	HappySedgingNoRun = `` /* 303-byte string literal not displayed */

	HappySedgingRun = `` /* 230-byte string literal not displayed */

	HappyStakingRun = `` /* 644-byte string literal not displayed */

	ExecutionClientNotSpecifiedWarn = "Execution client not provided. A random client will be selected. Random client: %s"
	ConsensusClientNotSpecifiedWarn = "Consensus client not provided. Selecting same pair of clients for consensus and validator clients"
	ValidatorClientNotSpecifiedWarn = "Validator client not provided. Selecting same pair of clients for consensus and validator clients"
	CLNotSpecifiedWarn              = "" /* 153-byte string literal not displayed */
	GeneratingJWTSecret             = "Generating JWT secret for client authentication"
	JWTSecretGenerated              = "JWT secret generated"
	CreatingKeystorePassword        = "Creating keystore_password.txt on keystore folder"
	KeystorePasswordCreated         = "keystore_password.txt on keystore folder created with provided password"
	MnemonicTips                    = "" /* 241-byte string literal not displayed */
	GeneratingMnemonic              = "Existing mnemonic not provided. Generating mnemonic for validator keystore:"
	StoreMnemonic                   = "Make sure to store your mnemonic somewhere safe. Losing it could end in the lost of your validators. Press enter to continue" // TODO: improve warning message
	PreparingTekuDatadir            = "Preparing teku datadirs (must have full read/write/execute permissions to work)"
	GettingContainersIP             = "Proceeding to get execution and consensus containers IP address for the monitoring tool"
	WaitingForNodesToStart          = "Waiting a minute for nodes to start"
	CustomExecutionImagesWarning    = "" /* 212-byte string literal not displayed */
	CustomConsensusImagesWarning    = "" /* 212-byte string literal not displayed */
	CustomValidatorImagesWarning    = "" /* 212-byte string literal not displayed */
	MapAllPortsWarning              = "" /* 152-byte string literal not displayed */
	CheckpointUrlUsedWarning        = "A Checkpoint Sync Url will be used for the consensus node. Using %s ."
	NoBootnodesFound                = "No bootnodes found in %s env file "
	UnableToCheckVersion            = "Unable to check for new Version. Please check manually at " +
		"https://github.com/NethermindEth/sedge/releases, with error:"
	NeedVersionUpdate = "A new Version of sedge is available. Please update to the latest Version. See " +
		"https://github.com/NethermindEth/sedge/releases for more information. Latest detected tag:"
	VersionUpdated             = "You are running the latest version of sedge. Version: "
	Downloading                = "Downloading %s..."
	Copying                    = "Copying %s..."
	GettingCustomChainSpec     = "Getting custom chain spec..."
	GettingCustomGenesis       = "Getting custom genesis..."
	GettingCustomNetworkConfig = "Getting custom network config..."
	WritingCustomDeployBlock   = "Writing custom deploy block..."
)

All the strings that are needed for debugging and info logging, and constant strings.

View Source
const (
	// Network names
	NetworkMainnet = "mainnet"
	NetworkGoerli  = "goerli"
	NetworkSepolia = "sepolia"
	NetworkGnosis  = "gnosis"
	NetworkChiado  = "chiado"
	NetworkHolesky = "holesky"
	NetworkCustom  = "custom"
)
View Source
const (
	ConfigFileName                      = ".sedge"
	CustomNetworkConfigsFolder          = "./custom_configs"
	DefaultDockerComposeScriptName      = "docker-compose.yml"
	ExecutionNetworkConfigFileName      = "chainSpec.json"
	ConsensusNetworkConfigFileName      = "config.yaml"
	ConsensusNetworkGenesisFileName     = "genesis.ssz"
	ConsensusNetworkDeployBlockFileName = "deploy_block.txt"
	ExecutionDir                        = "execution-data"
	ConsensusDir                        = "consensus-data"
	ValidatorDir                        = "validator-data"
	KeystoreDir                         = "keystore"
)
View Source
const (
	DefaultDiscoveryPortEL     uint16 = 30303
	DefaultMetricsPortEL       uint16 = 8008
	DefaultApiPortEL           uint16 = 8545
	DefaultAuthPortEL          uint16 = 8551
	DefaultWSPortEL            uint16 = 8546
	DefaultDiscoveryPortCL     uint16 = 9000
	DefaultMetricsPortCL       uint16 = 5054
	DefaultApiPortCL           uint16 = 4000
	DefaultAdditionalApiPortCL uint16 = 4001
	DefaultMetricsPortVL       uint16 = 5056
	DefaultMevPort             uint16 = 18550
)
View Source
const (
	MnemonicPresentation = `` /* 193-byte string literal not displayed */

)

Variables

View Source
var ClientImages struct {
	Execution struct {
		Geth       Image `yaml:"geth"`
		Besu       Image `yaml:"besu"`
		Nethermind Image `yaml:"nethermind"`
		Erigon     Image `yaml:"erigon"`
	}
	Consensus struct {
		Lighthouse Image `yaml:"lighthouse"`
		Lodestar   Image `yaml:"lodestar"`
		Teku       Image `yaml:"teku"`
		Prysm      Image `yaml:"prysm"`
	}
	Validator struct {
		Lighthouse Image `yaml:"lighthouse"`
		Lodestar   Image `yaml:"lodestar"`
		Teku       Image `yaml:"teku"`
		Prysm      Image `yaml:"prysm"`
	}
}
View Source
var DefaultAbsSedgeDataPath string
View Source
var Dependencies []string = []string{"docker"}
View Source
var ErrInvalidNetwork = errors.New("invalid network")

Functions

func GetDependencies

func GetDependencies() []string

GetDependencies : This function is responsible for giving the dependencies needed for sedge setup

params :- None

returns :- a. []string List of dependencies needed for sedge setup

func GetLoggingDriver added in v0.5.0

func GetLoggingDriver(loggingFlag string) string

GetLoggingDriver: Returns the logging driver name assocaited with the provided logging flag. Panics if the loggingFlag is not valid.

params :- a. loggingFlag string Flag of which want to know the associated driver.

returns :- a. string The associated logging driver.

func NetworkCheck added in v1.0.0

func NetworkCheck(value string) error

func NetworkEpochTime added in v1.0.0

func NetworkEpochTime(network string) time.Duration

func NetworkSupported added in v1.0.0

func NetworkSupported() []string

func NetworksConfigs added in v0.4.0

func NetworksConfigs() map[string]NetworkConfig

func SupportsMEVBoost added in v1.0.0

func SupportsMEVBoost(network string) bool

func ValidLoggingFlags added in v0.5.0

func ValidLoggingFlags() []string

ValidLoggingFlags: Provides the list of supported logging flags.

returns :- a. []string The list of supported logging flags.

func ValidateLoggingFlag added in v0.5.0

func ValidateLoggingFlag(loggingFlag string) error

ValidateLoggingFlag: Validates the provider loggingFlag. A loggingFlag is valid if is exactly equal to supported flags, for example: none, json.

params :- a. loggingFlag string Flag to validate.

returns :- a. error If the provided flag is valid then this error will be nil when returns, in another case, the proper error is returned.

Types

type Image added in v1.0.0

type Image struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
}

func (*Image) String added in v1.0.0

func (i *Image) String() string

type LogConfig

type LogConfig struct {
	Level string `mapstructure:"logLevel"`
}

LogConfig : Struct Represent configuration data for logging

type NetworkConfig added in v0.4.0

type NetworkConfig struct {
	Name                      string
	NoJWT                     bool
	NetworkService            string
	GenesisForkVersion        string
	DefaultECBootnodes        []string
	DefaultCCBootnodes        []string
	DefaultCustomChainSpecSrc string
	DefaultCustomConfigSrc    string
	DefaultCustomGenesisSrc   string
	DefaultCustomDeployBlock  string
	SupportsMEVBoost          bool
	CheckpointSyncURL         string
	RelayURLs                 []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL