api

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIConsensusClients added in v1.17.0

func APIConsensusClients(w http.ResponseWriter, r *http.Request)

APIConsensusClients returns consensus client node information as JSON @Summary Get consensus clients information @Description Returns a list of all connected consensus clients with their node information, including PeerDAS support. Sensitive information (PeerID, NodeID, ENR) is only included if ShowSensitivePeerInfos is enabled in the configuration. @Tags clients @Accept json @Produce json @Success 200 {object} APIConsensusClientsResponse @Failure 429 {object} map[string]string "Rate limit exceeded" @Failure 500 {object} map[string]string "Internal server error" @Router /v1/clients/consensus [get]

func APIExecutionClients added in v1.17.0

func APIExecutionClients(w http.ResponseWriter, r *http.Request)

APIExecutionClients returns execution client node information as JSON @Summary Get execution clients information @Description Returns a list of all connected execution clients with their node information. Sensitive information (IP addresses, ports, enode) is only included if ShowSensitivePeerInfos is enabled in the configuration. @Tags clients @Accept json @Produce json @Success 200 {object} APIExecutionClientsResponse @Failure 429 {object} map[string]string "Rate limit exceeded" @Failure 500 {object} map[string]string "Internal server error" @Router /v1/clients/execution [get]

func ApiEpochV1

func ApiEpochV1(w http.ResponseWriter, r *http.Request)

ApiEpoch godoc @Summary Get epoch by number, latest, finalized @Tags Epoch @Description Returns information for a specified epoch by the epoch number or an epoch tag (can be latest or finalized) @Produce json @Param epoch path string true "Epoch number, the string latest or the string finalized" @Success 200 {object} ApiResponse{data=APIEpochResponseV1} "Success" @Failure 400 {object} ApiResponse "Failure" @Failure 500 {object} ApiResponse "Server Error" @Router /v1/epoch/{epoch} [get]

func ApiValidatorByEth1AddressV1

func ApiValidatorByEth1AddressV1(w http.ResponseWriter, r *http.Request)

ApiValidatorByEth1Address godoc @Summary Get all validators that belong to an eth1 address @Tags Validator @Produce json @Param eth1address path string true "Eth1 address from which the validator deposits were sent". @Param limit query string false "Limit the number of results (default: 2000)" @Param offset query string false "Offset the results (default: 0)" @Success 200 {object} ApiResponse{data=[]ApiValidatorEth1ResponseV1} @Failure 400 {object} ApiResponse @Router /v1/validator/eth1/{eth1address} [get]

func ApiValidatorDepositsV1 added in v1.16.0

func ApiValidatorDepositsV1(w http.ResponseWriter, r *http.Request)

ApiValidatorDepositsV1 godoc @Summary Get validator execution layer deposits @Description Get all eth1 deposits for up to 100 validators @Tags Validators @Produce json @Param indexOrPubkey path string true "Up to 100 validator indicesOrPubkeys, comma separated" @Success 200 {object} api.ApiResponse{data=[]api.ApiValidatorDepositsResponseV1} @Failure 400 {object} api.ApiResponse @Router /v1/validator/{indexOrPubkey}/deposits [get]

func ApiValidatorGetV1

func ApiValidatorGetV1(w http.ResponseWriter, r *http.Request)

ApiValidator godoc @Summary Get up to 100 validators @Tags Validator @Description Searching for too many validators based on their pubkeys will lead to a "URI too long" error @Produce json @Param indexOrPubkey path string true "Up to 100 validator indicesOrPubkeys, comma separated" @Success 200 {object} ApiResponse{data=[]ApiValidatorResponseV1} @Failure 400 {object} ApiResponse @Router /v1/validator/{indexOrPubkey} [get]

func ApiValidatorPostV1

func ApiValidatorPostV1(w http.ResponseWriter, r *http.Request)

ApiValidator godoc @Summary Get up to 100 validators @Tags Validator @Description This POST endpoint exists because the GET endpoint can lead to a "URI too long" error when searching for too many validators based on their pubkeys. @Produce json @Param indexOrPubkey body ApiValidatorRequestV1 true "Up to 100 validator indicesOrPubkeys, comma separated" @Success 200 {object} ApiResponse{data=[]ApiValidatorResponseV1} @Failure 400 {object} ApiResponse @Router /v1/validator [post]

func ApiWithdrawalCredentialsValidatorsV1

func ApiWithdrawalCredentialsValidatorsV1(w http.ResponseWriter, r *http.Request)

ApiWithdrawalCredentialsValidators godoc @Summary Get all validators that have a specific withdrawal credentials @Tags Validator @Produce json @Param withdrawalCredentialsOrEth1address path string true "Provide a withdrawal credential or an eth1 address with an optional 0x prefix". It can also be a valid ENS name. @Param limit query int false "Limit the number of results, maximum: 200" default(10) @Param offset query int false "Offset the number of results" default(0) @Success 200 {object} ApiResponse{data=[]ApiWithdrawalCredentialsResponseV1} @Failure 400 {object} ApiResponse @Router /v1/validator/withdrawalCredentials/{withdrawalCredentialsOrEth1address} [get]

func SendOKResponse

func SendOKResponse(j *json.Encoder, route string, data []interface{})

Types

type APIConsensusClientNodeInfo added in v1.17.0

type APIConsensusClientNodeInfo struct {
	ClientName         string    `json:"client_name"`
	ClientType         string    `json:"client_type"`
	Version            string    `json:"version"`
	PeerID             string    `json:"peer_id"`
	NodeID             string    `json:"node_id"`
	ENR                string    `json:"enr"`
	HeadSlot           uint64    `json:"head_slot"`
	HeadRoot           string    `json:"head_root"`
	Status             string    `json:"status"`
	PeerCount          uint32    `json:"peer_count"`
	PeersInbound       uint32    `json:"peers_inbound"`
	PeersOutbound      uint32    `json:"peers_outbound"`
	LastRefresh        time.Time `json:"last_refresh"`
	LastError          string    `json:"last_error,omitempty"`
	SupportsDataColumn bool      `json:"supports_data_column"`
	ColumnIndexes      []uint64  `json:"column_indexes,omitempty"`
}

APIConsensusClientNodeInfo represents the response structure for consensus client node info

type APIConsensusClientsResponse added in v1.17.0

type APIConsensusClientsResponse struct {
	Clients []APIConsensusClientNodeInfo `json:"clients"`
	Count   int                          `json:"count"`
}

APIConsensusClientsResponse represents the full API response

type APIEpochResponseV1

type APIEpochResponseV1 struct {
	Epoch                   uint64 `json:"epoch"`
	Ts                      uint64 `json:"ts"`
	AttestationsCount       uint64 `json:"attestationscount"`
	AttesterSlashingsCount  uint64 `json:"attesterslashingscount"`
	AverageValidatorBalance uint64 `json:"averagevalidatorbalance"`
	BlocksCount             uint64 `json:"blockscount"`
	DepositsCount           uint64 `json:"depositscount"`
	EligibleEther           uint64 `json:"eligibleether"`
	Finalized               bool   `json:"finalized"`
	GlobalParticipationRate uint64 `json:"globalparticipationrate"`
	MissedBlocks            uint64 `json:"missedblocks"`
	OrphanedBlocks          uint64 `json:"orphanedblocks"`
	ProposedBlocks          uint64 `json:"proposedblocks"`
	ProposerSlashingsCount  uint64 `json:"proposerslashingscount"`
	ScheduledBlocks         uint64 `json:"scheduledblocks"`
	TotalValidatorBalance   uint64 `json:"totalvalidatorbalance"`
	ValidatorsCount         uint64 `json:"validatorscount"`
	VoluntaryExitsCount     uint64 `json:"voluntaryexitscount"`
	VotedEther              uint64 `json:"votedether"`
	RewardsExported         uint64 `json:"rewards_exported"`
	WithdrawalCount         uint64 `json:"withdrawalcount"`
}

type APIExecutionClientNodeInfo added in v1.17.0

type APIExecutionClientNodeInfo struct {
	ClientName string    `json:"client_name"`
	NodeID     string    `json:"node_id"`
	Enode      string    `json:"enode"`
	IP         string    `json:"ip"`
	Port       int       `json:"port"`
	Version    string    `json:"version"`
	Status     string    `json:"status"`
	LastUpdate time.Time `json:"last_update"`
}

APIExecutionClientNodeInfo represents the response structure for execution client node info

type APIExecutionClientsResponse added in v1.17.0

type APIExecutionClientsResponse struct {
	Clients []APIExecutionClientNodeInfo `json:"clients"`
	Count   int                          `json:"count"`
}

APIExecutionClientsResponse represents the full API response

type ApiResponse

type ApiResponse struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
}

type ApiValidatorDepositsResponseV1 added in v1.16.0

type ApiValidatorDepositsResponseV1 struct {
	Amount                uint64 `json:"amount"`
	BlockNumber           uint64 `json:"block_number"`
	BlockTS               uint64 `json:"block_ts"`
	FromAddress           string `json:"from_address"`
	MerkleTreeIndex       string `json:"merkletree_index"`
	PublicKey             string `json:"publickey"`
	Removed               bool   `json:"removed"`
	Signature             string `json:"signature"`
	TxHash                string `json:"tx_hash"`
	TxIndex               uint64 `json:"tx_index"`
	TxInput               string `json:"tx_input"`
	ValidSignature        bool   `json:"valid_signature"`
	WithdrawalCredentials string `json:"withdrawal_credentials"`
}

type ApiValidatorEth1ResponseV1

type ApiValidatorEth1ResponseV1 struct {
	PublicKey      string `json:"public_key"`
	ValidSignature bool   `json:"valid_signature"`
	ValidatorIndex uint64 `json:"validator_index"`
}

type ApiValidatorRequestV1 added in v1.17.0

type ApiValidatorRequestV1 struct {
	IndicesOrPubKey string `json:"indicesOrPubkey"`
}

type ApiValidatorResponseV1

type ApiValidatorResponseV1 struct {
	Activationeligibilityepoch uint64 `json:"activationeligibilityepoch"`
	Activationepoch            uint64 `json:"activationepoch"`
	Balance                    uint64 `json:"balance"`
	Effectivebalance           uint64 `json:"effectivebalance"`
	Exitepoch                  uint64 `json:"exitepoch"`
	Isonline                   bool   `json:"isonline"`
	Name                       string `json:"name"`
	Pubkey                     string `json:"pubkey"`
	Slashed                    bool   `json:"slashed"`
	Status                     string `json:"status"`
	Validatorindex             uint64 `json:"validatorindex"`
	Withdrawableepoch          uint64 `json:"withdrawableepoch"`
	Withdrawalcredentials      string `json:"withdrawalcredentials"`
}

type ApiWithdrawalCredentialsResponseV1

type ApiWithdrawalCredentialsResponseV1 struct {
	PublicKey      string `json:"publickey"`
	ValidatorIndex uint64 `json:"validatorindex"`
}

Jump to

Keyboard shortcuts

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