github.com/kotalco/kotal@v0.3.0/apis/ethereum2/v1alpha1/client.go (about)

     1  package v1alpha1
     2  
     3  import "github.com/kotalco/kotal/apis/shared"
     4  
     5  // Ethereum2Client is Ethereum 2.0 client
     6  // +kubebuilder:validation:Enum=teku;prysm;lighthouse;nimbus
     7  type Ethereum2Client string
     8  
     9  const (
    10  	// TekuClient is ConsenSys Pegasys Ethereum 2.0 client
    11  	TekuClient Ethereum2Client = "teku"
    12  	// PrysmClient is Prysmatic Labs Ethereum 2.0 client
    13  	PrysmClient Ethereum2Client = "prysm"
    14  	// LighthouseClient is SigmaPrime Ethereum 2.0 client
    15  	LighthouseClient Ethereum2Client = "lighthouse"
    16  	// NimbusClient is Status Ethereum 2.0 client
    17  	NimbusClient Ethereum2Client = "nimbus"
    18  )
    19  
    20  func (client Ethereum2Client) SupportsVerbosityLevel(level shared.VerbosityLevel, validator bool) bool {
    21  	switch client {
    22  
    23  	case TekuClient:
    24  		switch level {
    25  		case shared.NoLogs,
    26  			shared.FatalLogs,
    27  			shared.ErrorLogs,
    28  			shared.WarnLogs,
    29  			shared.InfoLogs,
    30  			shared.DebugLogs,
    31  			shared.TraceLogs,
    32  			shared.AllLogs:
    33  			return true
    34  		}
    35  
    36  	case PrysmClient:
    37  		switch level {
    38  		case shared.TraceLogs,
    39  			shared.DebugLogs,
    40  			shared.InfoLogs,
    41  			shared.WarnLogs,
    42  			shared.ErrorLogs,
    43  			shared.FatalLogs,
    44  			shared.PanicLogs:
    45  			return true
    46  		}
    47  
    48  	case LighthouseClient:
    49  		switch level {
    50  		case shared.InfoLogs,
    51  			shared.DebugLogs,
    52  			shared.TraceLogs,
    53  			shared.WarnLogs,
    54  			shared.ErrorLogs,
    55  			shared.CriticalLogs:
    56  			return true
    57  		}
    58  
    59  	case NimbusClient:
    60  		switch level {
    61  		case shared.TraceLogs,
    62  			shared.DebugLogs,
    63  			shared.InfoLogs,
    64  			shared.NoticeLogs,
    65  			shared.WarnLogs,
    66  			shared.ErrorLogs,
    67  			shared.FatalLogs,
    68  			shared.NoneLogs:
    69  			return true
    70  		}
    71  	}
    72  
    73  	return false
    74  }