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.
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 AssingPorts(host string, defaults map[string]string) (ports map[string]string, err error)
- func CheckContainers(generationPath string) (string, error)
- func CheckDependencies(dependencies []string) (pending []string)
- func CheckErr(descr string, isErr bool, err error) error
- func Contains(list []string, str string) bool
- func ContainsOnly(list []string, target []string) bool
- func CurrentVersion() string
- func Filter[K any](list []K, filter func(K) bool) []K
- func GenerateValidatorKey(arg ValidatorKeyData) (err error)
- func GetDistroName() (_ string, err error)
- func HandleInstructions(dependencies []string, handler func(string) error) (err error)
- func InstallDependency(dependency string) (err error)
- func IsAddress(a string) bool
- func IsLatestVersion() (bool, error)
- func PreCheck(generationPath string) error
- func ShowInstructions(dependency string) error
- func SkipLines(content string, symbol string) string
- func SupportedNetworks() (networkNames []string, err error)
- func ZipString(lists ...[]string) ([][]string, error)
- type DepositCLI
- type DistroInfo
- type ValidatorKeyData
Constants ¶
This section is empty.
Variables ¶
var ( ErrorNoTag = errors.New("no tag found on Github") ErrorCheckingVersion = errors.New("error while checking for new Version, please check your internet connection") )
var Version string
Version represents the current version of Sedge
Functions ¶
func AssingPorts ¶
AssingPorts : Checks if port is occupied in a given host
params :- a. host string Host which port is to be checked b. port string Port to be checked
returns :- a. bool True if <port> is available. False otherwise
func CheckContainers ¶
CheckContainers : Check if containers of generated docker-compose script are running
params :- a. generationPath string Path to the generated docker-compose script
returns :- a. string Output of 'docker ps --services --filter status=running' b. error Error if any
func CheckDependencies ¶
CheckDependencies : This function is responsible for checking if on-premise setup dependencies are installed on host machine
params :- a. dependencies []string List of dependencies to be checked
returns :- a. []string List of dependencies that are not installed
func CheckErr ¶
CheckErr : Helper function for tests. Check if a given error was expected.
params :- a. desc string Description of the error in case of failure b. isError bool Whether the error was expected or not c. err error Error to check
returns :- a. error Error if any
func Contains ¶
Contains : Checks if a string slice contains a string
params :- a. list []string String slice to be checked b. str string String to be checked
returns :- a. bool True if str is in list, false otherwise
func ContainsOnly ¶
ContainsOnly : Checks if a string slice contains only strings of a given string slice
params :- a. list []string String slice to be checked b. target []string String slice to be checked
returns :- a. bool True if every string in list is in target, false otherwise
func CurrentVersion ¶ added in v0.4.0
func CurrentVersion() string
CurrentVersion : Export the current version of Sedge
params :- None
returns :- a. string Return the current version of Sedge
func Filter ¶ added in v0.3.0
Filter : Filter a slice given a predicate
params :- a. list []K List to be filtered b. filter func(K) bool Predicate to be applied to each element of the list
returns :- a. []K Filtered list
func GenerateValidatorKey ¶
func GenerateValidatorKey(arg ValidatorKeyData) (err error)
GenerateValidatorKey : Generates a validator key using the eth2.0-deposit-cli tool. The key can be generated using a new or existing mnemonic. Key's path is set to $(pwd)/keystore.
params :- a. arg ValidatorKeyData Data for keystore generation
returns :- a. error Error if any
func GetDistroName ¶
GetDistroName : Get the name and version of the linux distribution of the host machine.
params :- None
returns :- a. string "<Distribution_Name> <Distribution_Version>" a. error Error if any
func HandleInstructions ¶
HandleInstructions : This function is responsible for handling the dependencies needed for sedge setup If install support for a dependency exists, then `handler` will process it, for example, installing it or showing instructions for it.
params :- a. []string dependencies List of dependencies needed for sedge setup b. func(string) error handler Handler for each dependency
returns :- a. error Error if any
func InstallDependency ¶
InstallDependency : This function is responsible for installing the dependencies using pre-written bash scripts
params :- a. string dependency Dependency to be installed
returns :- a. error Error if any
func IsAddress ¶
IsAddress : Checks if a string is an Ethereum address
params :- a. a string String to be checked
returns :- a. bool True if <a> is a valid Ethereum address. False otherwise
func IsLatestVersion ¶ added in v0.4.0
IsLatestVersion : Check if we are running the latest version that was released on GitHub
params :- None
returns :- a. bool Returns true if we are on the latest version, but false if we have a different version that latest on Github. a. err error Error if any
func PreCheck ¶
PreCheck : Check if docker-compose can be used to interact with the generated docker-compose script
params :- a. generationPath string Path to the generated docker-compose script
returns :- a. error Error if any
func ShowInstructions ¶
ShowInstructions : This function is responsible for showing instructions for installing each dependency
params :- a. string dependency Dependency whose instruction will be showed
returns :- a. error Error if any
func SkipLines ¶
SkipLines : Skips lines starting with `symbol`
params :- a. content string String to be processed b. symbol string Symbol to be skipped
returns :- a. string Processed string
func SupportedNetworks ¶
SupportedNetworks : Get supported networks names. A network is supported if it has a folder with the network name in either templates/envs or templates/services forder.
params :- none
returns :- a. []string List of supported network names b. error Error if any
Types ¶
type DepositCLI ¶
type DepositCLI struct { // Network : Network name, e.g. "mainnet", "goerli" Network string // Path : Path to the keystore folder Path string // Password : Keystore password Password string // LenPass : Slice used to hide password in template LenPass []struct{} // Image : staking-deposit-cli docker image Image string // Eth1WithdrawalAddress : Address to be used to create withdrawal credentials Eth1WithdrawalAddress string }
DepositCLI : Struct Data for eth2.0-deposit-cli command template
type DistroInfo ¶
DistroInfo : Struct Contains name, architecture and version of the linux distribution of the host machine
type ValidatorKeyData ¶
type ValidatorKeyData struct { // Existing: True if a existing mnemonic is being used. False to create and use a new one. Existing bool // Network : Target network Network string // Path : Path to the keystore folder Path string // Password : Keystore password Password string // Eth1WithdrawalAddress : Address to be used to create withdrawal credentials Eth1WithdrawalAddress string }
ValidatorKeyData : Struct Data for Keystore generation