clients

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 10 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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
	Omited    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

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 and configured clients

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

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 network <network>. A client is supported if it has a docker-compose service template

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

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
}

Client : 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