clients

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: 9 Imported by: 0

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.

Index

Constants

This section is empty.

Variables

View Source
var AllClients map[string][]string = map[string][]string{
	"execution": {
		"nethermind",
		"geth",
		"erigon",
		"besu",
	},
	"consensus": {
		"lighthouse",
		"prysm",
		"teku",
		"lodestar",
	},
	"validator": {
		"lighthouse",
		"prysm",
		"teku",
		"lodestar",
	},
}
View Source
var ErrEmptyClientsList = errors.New("empty clients list")

ErrEmptyClientsList is returned when the clients list is empty

Functions

func RandomClientName added in v1.0.0

func RandomClientName(clients []string) (client string, err error)

RandomClientName returns a random client name from a list of clients

func ValidateClient

func ValidateClient(client *Client, currentType string) error

ValidateClient : Validate if the client is supported and configured

params :- a. client Client Client to be validated

returns :- a. error Error if client is not supported or configured

Types

type Client

type Client struct {
	Name      string
	Type      string
	Image     string
	Endpoint  string
	Supported bool
}

Client : Struct Represent a client like geth, prysm, etc

func RandomChoice

func RandomChoice(clients ClientMap) (client *Client, err error)

RandomChoice : Select a random supported client from a ClientMap

params :- a. clients ClientMap Target clients

returns :- a. Client Random element from list b. error Error if any

func (*Client) SetImageOrDefault added in v1.0.0

func (c *Client) SetImageOrDefault(image string)

type ClientInfo

type ClientInfo struct {
	Network string
}

ClientInfo : Struct Interface for listing available clients

func (ClientInfo) Clients

func (c ClientInfo) Clients(clientTypes []string) (clients OrderedClients, errs []error)

Clients : Get all the supported clients for the ClientInfo's network

params :- a. clientTypes []string Types of client supported. E.g execution, consensus, validator

returns :- a. OrderedClients Map of <clientType>: map of <clientName>: Client b. []error List of errors

func (ClientInfo) SupportedClients

func (c ClientInfo) SupportedClients(clientType string) (clientsNames []string, err error)

SupportedClients : Get supported client names of type <clientType> for the ClientInfo's network. A client is supported if it has a docker-compose service template

params :- a. clientType string Type of client to be returned

returns :- a. []string List of supported clients names of type <clientType> b. error Error if any

type ClientMap

type ClientMap map[string]*Client

type Clients

type Clients struct {
	Execution *Client
	Consensus *Client
	Validator *Client
}

Clients : Struct Represent a combination of execution, consensus and validator clients

type OrderedClients

type OrderedClients map[string]ClientMap

Jump to

Keyboard shortcuts

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