beacon

package
v5.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	SyncChecker           sync.Checker
	HeadFetcher           blockchain.HeadFetcher
	TimeFetcher           blockchain.TimeFetcher
	OptimisticModeFetcher blockchain.OptimisticModeFetcher
	CanonicalHistory      *stategen.CanonicalHistory
	BeaconDB              beacondb.ReadOnlyDatabase
	Stater                lookup.Stater
	ChainInfoFetcher      blockchain.ChainInfoFetcher
	FinalizationFetcher   blockchain.FinalizationFetcher
}

func (*Server) GetValidatorCount

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) GetWeakSubjectivity

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

GetWeakSubjectivity computes the starting epoch of the current weak subjectivity period, and then also determines the best block root and state root to use for a Checkpoint Sync starting from that point.

Jump to

Keyboard shortcuts

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