validator

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: GPL-3.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count added in v4.2.0

type Count struct {
	Status string `json:"status"`
	Count  string `json:"count"`
}

type CountResponse added in v4.2.0

type CountResponse struct {
	ExecutionOptimistic string   `json:"execution_optimistic"`
	Finalized           string   `json:"finalized"`
	Data                []*Count `json:"data"`
}

type PerformanceRequest added in v4.2.0

type PerformanceRequest struct {
	PublicKeys [][]byte                    `json:"public_keys,omitempty"`
	Indices    []primitives.ValidatorIndex `json:"indices,omitempty"`
}

type PerformanceResponse added in v4.2.0

type PerformanceResponse struct {
	PublicKeys                    [][]byte `json:"public_keys,omitempty"`
	CorrectlyVotedSource          []bool   `json:"correctly_voted_source,omitempty"`
	CorrectlyVotedTarget          []bool   `json:"correctly_voted_target,omitempty"`
	CorrectlyVotedHead            []bool   `json:"correctly_voted_head,omitempty"`
	CurrentEffectiveBalances      []uint64 `json:"current_effective_balances,omitempty"`
	BalancesBeforeEpochTransition []uint64 `json:"balances_before_epoch_transition,omitempty"`
	BalancesAfterEpochTransition  []uint64 `json:"balances_after_epoch_transition,omitempty"`
	MissingValidators             [][]byte `json:"missing_validators,omitempty"`
	InactivityScores              []uint64 `json:"inactivity_scores,omitempty"`
}

type Server

type Server struct {
	GenesisTimeFetcher    blockchain.TimeFetcher
	SyncChecker           sync.Checker
	HeadFetcher           blockchain.HeadFetcher
	CoreService           *core.Service
	OptimisticModeFetcher blockchain.OptimisticModeFetcher
	Stater                lookup.Stater
	ChainInfoFetcher      blockchain.ChainInfoFetcher
	BeaconDB              db.ReadOnlyDatabase
	FinalizationFetcher   blockchain.FinalizationFetcher
}

Server defines a server implementation for HTTP endpoints, providing access data relevant to the Ethereum Beacon Chain.

func (*Server) GetValidatorCount added in v4.1.0

func (s *Server) GetValidatorCount(w http.ResponseWriter, r *http.Request)

GetValidatorCount is a HTTP handler that serves the GET /eth/v1/beacon/states/{state_id}/validator_count endpoint. It returns the total validator count according to the given statuses provided as a query parameter.

The state ID is expected to be a valid Beacon Chain state identifier. The status query parameter can be an array of strings with the following values: pending_initialized, pending_queued, active_ongoing, active_exiting, active_slashed, exited_unslashed, exited_slashed, withdrawal_possible, withdrawal_done, active, pending, exited, withdrawal. The response is a JSON object containing the total validator count for the specified statuses.

Example usage:

GET /eth/v1/beacon/states/12345/validator_count?status=active&status=pending

The above request will return a JSON response like:

{
	"execution_optimistic": "false",
	"finalized": "true",
	"data": [
		{
			"status": "active",
			"count": "13"
		},
		{
			"status": "pending",
			"count": "6"
		}
	]
}

func (*Server) GetValidatorPerformance

func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request)

GetValidatorPerformance is an HTTP handler for GetValidatorPerformance.

Jump to

Keyboard shortcuts

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