eth2spec

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

README

Go API client for eth2spec

API specification for the beacon node, which enables users to query and participate in Ethereum 2.0 phase 0 beacon chain.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./eth2spec"

Documentation for API Endpoints

All URIs are relative to http://public-mainnet-node.ethereum.org/api

Class Method HTTP request Description
BeaconApi GetBlock Get /eth/v1/beacon/blocks/{block_id} Get block
BeaconApi GetBlockAttestations Get /eth/v1/beacon/blocks/{block_id}/attestations Get block attestations
BeaconApi GetBlockHeader Get /eth/v1/beacon/headers/{block_id} Get block header
BeaconApi GetBlockHeaders Get /eth/v1/beacon/headers Get block headers
BeaconApi GetBlockRoot Get /eth/v1/beacon/blocks/{block_id}/root Get block root
BeaconApi GetEpochCommittees Get /eth/v1/beacon/states/{state_id}/committees/{epoch} Get all committees for epoch
BeaconApi GetGenesis Get /eth/v1/beacon/genesis Retrieve details of the chain's genesis.
BeaconApi GetPoolAttestations Get /eth/v1/beacon/pool/attestations Get Attestations from operations pool
BeaconApi GetPoolAttesterSlashings Get /eth/v1/beacon/pool/atttester_slashings Get AttesterSlashings from operations pool
BeaconApi GetPoolProposerSlashings Get /eth/v1/beacon/pool/proposer_slashings Get ProposerSlashings from operations pool
BeaconApi GetPoolVoluntaryExits Get /eth/v1/beacon/pool/voluntary_exits Get SignedVoluntaryExit from operations pool
BeaconApi GetStateFinalityCheckpoints Get /eth/v1/beacon/states/{state_id}/finality_checkpoints Get state finality checkpoints
BeaconApi GetStateFork Get /eth/v1/beacon/states/{state_id}/fork Get Fork object for requested state
BeaconApi GetStateRoot Get /eth/v1/beacon/states/{state_id}/root Get state SSZ HashTreeRoot
BeaconApi GetStateValidator Get /eth/v1/beacon/states/{state_id}/validators/{validator_id} Get validator from state by id
BeaconApi GetStateValidators Get /eth/v1/beacon/states/{state_id}/validators Get validators from state
BeaconApi PublishBlock Post /eth/v1/beacon/blocks Publish a signed block.
BeaconApi SubmitPoolAttestations Post /eth/v1/beacon/pool/attestations Submit Attestation object to node
BeaconApi SubmitPoolAttesterSlashings Post /eth/v1/beacon/pool/atttester_slashings Submit AttesterSlashing object to node's pool
BeaconApi SubmitPoolProposerSlashings Post /eth/v1/beacon/pool/proposer_slashings Submit ProposerSlashing object to node's pool
BeaconApi SubmitPoolVoluntaryExit Post /eth/v1/beacon/pool/voluntary_exits Submit SignedVoluntaryExit object to node's pool
ConfigApi GetDepositContract Get /eth/v1/config/deposit_contract Get deposit contract address.
ConfigApi GetForkSchedule Get /eth/v1/config/fork_schedule Get scheduled upcoming forks.
ConfigApi GetSpec Get /eth/v1/config/spec Get spec params.
DebugApi GetDebugChainHeads Get /eth/v1/debug/beacon/heads Get fork choice leaves
DebugApi GetState Get /eth/v1/debug/beacon/states/{state_id} Get full BeaconState object
EventsApi Eventstream Get /eth/v1/events Subscribe to beacon node events
NodeApi GetHealth Get /eth/v1/node/health Get health check
NodeApi GetNetworkIdentity Get /eth/v1/node/identity Get node network identity
NodeApi GetNodeVersion Get /eth/v1/node/version Get version string of the running beacon node.
NodeApi GetPeer Get /eth/v1/node/peers/{peer_id} Get peer
NodeApi GetPeers Get /eth/v1/node/peers Get node network peers
NodeApi GetSyncingStatus Get /eth/v1/node/syncing Get node syncing status
ValidatorApi GetAggregatedAttestation Get /eth/v1/validator/aggregate_attestation Get aggregated attestation
ValidatorApi GetAttesterDuties Get /eth/v1/validator/duties/attester/{epoch} Get attester duties
ValidatorApi GetProposerDuties Get /eth/v1/validator/duties/proposer/{epoch} Get block proposers duties
ValidatorApi PrepareBeaconCommitteeSubnet Post /eth/v1/validator/beacon_committee_subscriptions Signal beacon node to prepare for a committee subnet
ValidatorApi ProduceAttestationData Get /eth/v1/validator/attestation_data Produce an attestation data
ValidatorApi ProduceBlock Get /eth/v1/validator/blocks/{slot} Produce a new block, without signature.
ValidatorApi PublishAggregateAndProof Post /eth/v1/validator/aggregate_and_proofs Publish aggregate and proof
ValidatorRequiredApiApi GetAggregatedAttestation Get /eth/v1/validator/aggregate_attestation Get aggregated attestation
ValidatorRequiredApiApi GetAttesterDuties Get /eth/v1/validator/duties/attester/{epoch} Get attester duties
ValidatorRequiredApiApi GetGenesis Get /eth/v1/beacon/genesis Retrieve details of the chain's genesis.
ValidatorRequiredApiApi GetProposerDuties Get /eth/v1/validator/duties/proposer/{epoch} Get block proposers duties
ValidatorRequiredApiApi GetStateFork Get /eth/v1/beacon/states/{state_id}/fork Get Fork object for requested state
ValidatorRequiredApiApi GetStateValidator Get /eth/v1/beacon/states/{state_id}/validators/{validator_id} Get validator from state by id
ValidatorRequiredApiApi GetSyncingStatus Get /eth/v1/node/syncing Get node syncing status
ValidatorRequiredApiApi PrepareBeaconCommitteeSubnet Post /eth/v1/validator/beacon_committee_subscriptions Signal beacon node to prepare for a committee subnet
ValidatorRequiredApiApi ProduceAttestationData Get /eth/v1/validator/attestation_data Produce an attestation data
ValidatorRequiredApiApi ProduceBlock Get /eth/v1/validator/blocks/{slot} Produce a new block, without signature.
ValidatorRequiredApiApi PublishAggregateAndProof Post /eth/v1/validator/aggregate_and_proofs Publish aggregate and proof
ValidatorRequiredApiApi PublishBlock Post /eth/v1/beacon/blocks Publish a signed block.
ValidatorRequiredApiApi SubmitPoolAttestations Post /eth/v1/beacon/pool/attestations Submit Attestation object to node

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	BeaconApi *BeaconApiService

	ConfigApi *ConfigApiService

	DebugApi *DebugApiService

	EventsApi *EventsApiService

	NodeApi *NodeApiService

	ValidatorApi *ValidatorApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Eth2 Beacon Node API API vDev - Eth2Spec v0.12.2 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type Attestation

type Attestation struct {
	// Attester aggregation bits.
	AggregationBits string                           `json:"aggregation_bits,omitempty"`
	Signature       string                           `json:"signature,omitempty"`
	Data            GetBlockAttestationsResponseData `json:"data,omitempty"`
}

Attestation The [`Attestation`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#attestation) object from the Eth2.0 spec.

type AttestationData added in v0.3.0

type AttestationData struct {
	Slot            string                                                   `json:"slot,omitempty"`
	Index           string                                                   `json:"index,omitempty"`
	BeaconBlockRoot string                                                   `json:"beacon_block_root,omitempty"`
	Source          GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"source,omitempty"`
	Target          GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"target,omitempty"`
}

AttestationData The [`AttestationData`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#attestationdata) object from the Eth2.0 spec.

type AttesterDuty

type AttesterDuty struct {
	// The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._
	Pubkey                  string `json:"pubkey,omitempty"`
	CommitteeIndex          string `json:"committee_index,omitempty"`
	CommitteeLength         string `json:"committee_length,omitempty"`
	ValidatorCommitteeIndex string `json:"validator_committee_index,omitempty"`
	Slot                    string `json:"slot,omitempty"`
}

AttesterDuty struct for AttesterDuty

type AttesterSlashing

type AttesterSlashing struct {
	Attestation1 GetPoolAttesterSlashingsResponseAttestation1 `json:"attestation_1,omitempty"`
	Attestation2 GetPoolAttesterSlashingsResponseAttestation1 `json:"attestation_2,omitempty"`
}

AttesterSlashing The [`AttesterSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/core/0_beacon-chain.md#attesterslashing) object from the Eth2.0 spec.

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type BeaconApiService

type BeaconApiService service

BeaconApiService BeaconApi service

func (*BeaconApiService) GetBlock

GetBlock Get block Retrieves block details for given block id.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param blockId Block identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \\<slot\\>, \\<hex encoded blockRoot with 0x prefix\\>.

@return GetBlockResponse

func (*BeaconApiService) GetBlockAttestations

func (a *BeaconApiService) GetBlockAttestations(ctx _context.Context, blockId string) (GetBlockAttestationsResponse, *_nethttp.Response, error)

GetBlockAttestations Get block attestations Retrieves attestation included in requested block.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param blockId Block identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \\<slot\\>, \\<hex encoded blockRoot with 0x prefix\\>.

@return GetBlockAttestationsResponse

func (*BeaconApiService) GetBlockHeader

GetBlockHeader Get block header Retrieves block header for given block id.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param blockId Block identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \\<slot\\>, \\<hex encoded blockRoot with 0x prefix\\>.

@return GetBlockHeaderResponse

func (*BeaconApiService) GetBlockHeaders

func (a *BeaconApiService) GetBlockHeaders(ctx _context.Context, localVarOptionals *GetBlockHeadersOpts) (GetBlockHeadersResponse, *_nethttp.Response, error)

GetBlockHeaders Get block headers Retrieves block headers matching given query. By default it will fetch current head slot blocks.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *GetBlockHeadersOpts - Optional Parameters:
  • @param "Slot" (optional.Interface of string) -
  • @param "ParentRoot" (optional.Interface of string) -

@return GetBlockHeadersResponse

func (*BeaconApiService) GetBlockRoot

GetBlockRoot Get block root Retrieves hashTreeRoot of BeaconBlock/BeaconBlockHeader

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param blockId Block identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \\<slot\\>, \\<hex encoded blockRoot with 0x prefix\\>.

@return GetBlockRootResponse

func (*BeaconApiService) GetEpochCommittees

func (a *BeaconApiService) GetEpochCommittees(ctx _context.Context, stateId string, epoch string, localVarOptionals *GetEpochCommitteesOpts) (GetEpochCommitteesResponse, *_nethttp.Response, error)

GetEpochCommittees Get all committees for epoch Retrieves the committees for the given state at the given epoch.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.
  • @param epoch Epoch for which to calculate committees. Defaults to beacon state epoch.
  • @param optional nil or *GetEpochCommitteesOpts - Optional Parameters:
  • @param "Index" (optional.Interface of string) - Committee index
  • @param "Slot" (optional.Interface of string) -

@return GetEpochCommitteesResponse

func (*BeaconApiService) GetGenesis

GetGenesis Retrieve details of the chain's genesis. Retrieve details of the chain&#39;s genesis which can be used to identify chain.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetGenesisResponse

func (*BeaconApiService) GetPoolAttestations

func (a *BeaconApiService) GetPoolAttestations(ctx _context.Context, localVarOptionals *GetPoolAttestationsOpts) (GetBlockAttestationsResponse, *_nethttp.Response, error)

GetPoolAttestations Get Attestations from operations pool Retrieves attestations known by the node but not necessarily incorporated into any block

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *GetPoolAttestationsOpts - Optional Parameters:
  • @param "Slot" (optional.String) -
  • @param "CommitteeIndex" (optional.String) -

@return GetBlockAttestationsResponse

func (*BeaconApiService) GetPoolAttesterSlashings

GetPoolAttesterSlashings Get AttesterSlashings from operations pool Retrieves attester slashings known by the node but not necessarily incorporated into any block

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetPoolAttesterSlashingsResponse

func (*BeaconApiService) GetPoolProposerSlashings

GetPoolProposerSlashings Get ProposerSlashings from operations pool Retrieves proposer slashings known by the node but not necessarily incorporated into any block

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetPoolProposerSlashingsResponse

func (*BeaconApiService) GetPoolVoluntaryExits

GetPoolVoluntaryExits Get SignedVoluntaryExit from operations pool Retrieves voluntary exits known by the node but not necessarily incorporated into any block

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetPoolVoluntaryExitsResponse

func (*BeaconApiService) GetStateFinalityCheckpoints

func (a *BeaconApiService) GetStateFinalityCheckpoints(ctx _context.Context, stateId string) (GetStateFinalityCheckpointsResponse, *_nethttp.Response, error)

GetStateFinalityCheckpoints Get state finality checkpoints Returns finality checkpoints for state with given &#39;stateId&#39;. In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.

@return GetStateFinalityCheckpointsResponse

func (*BeaconApiService) GetStateFork

GetStateFork Get Fork object for requested state Returns Fork(https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#fork) object for state with given &#39;stateId&#39;.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.

@return GetStateForkResponse

func (*BeaconApiService) GetStateRoot

GetStateRoot Get state SSZ HashTreeRoot Calculates HashTreeRoot for state with given &#39;stateId&#39;. If stateId is root, same value will be returned.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.

@return GetStateRootResponse

func (*BeaconApiService) GetStateValidator

func (a *BeaconApiService) GetStateValidator(ctx _context.Context, stateId string, validatorId string) (GetStateValidatorResponse, *_nethttp.Response, error)

GetStateValidator Get validator from state by id Returns validator specified by state and id or public key along with status and balance.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.
  • @param validatorId Either hex encoded public key (with 0x prefix) or validator index

@return GetStateValidatorResponse

func (*BeaconApiService) GetStateValidators

func (a *BeaconApiService) GetStateValidators(ctx _context.Context, stateId string, localVarOptionals *GetStateValidatorsOpts) (GetStateValidatorsResponse, *_nethttp.Response, error)

GetStateValidators Get validators from state Returns filterable list of validators with their balance, status and index.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.
  • @param optional nil or *GetStateValidatorsOpts - Optional Parameters:
  • @param "Id" (optional.Interface of []string) - Either hex encoded public key (with 0x prefix) or validator index
  • @param "Status" (optional.Interface of []string) - [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)

@return GetStateValidatorsResponse

func (*BeaconApiService) PublishBlock added in v0.3.0

func (a *BeaconApiService) PublishBlock(ctx _context.Context, inlineObject InlineObject) (*_nethttp.Response, error)

PublishBlock Publish a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed &#x60;BeaconBlock&#x60;, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202)

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param inlineObject

func (*BeaconApiService) SubmitPoolAttestations

func (a *BeaconApiService) SubmitPoolAttestations(ctx _context.Context, inlineObject1 InlineObject1) (*_nethttp.Response, error)

SubmitPoolAttestations Submit Attestation object to node Submits Attestation object to node. If attestation passes all validation constraints, node MUST publish attestation on appropriate subnet.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param inlineObject1

func (*BeaconApiService) SubmitPoolAttesterSlashings

func (a *BeaconApiService) SubmitPoolAttesterSlashings(ctx _context.Context, inlineObject2 InlineObject2) (*_nethttp.Response, error)

SubmitPoolAttesterSlashings Submit AttesterSlashing object to node's pool Submits AttesterSlashing object to node&#39;s pool and if passes validation node MUST broadcast it to network.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param inlineObject2

func (*BeaconApiService) SubmitPoolProposerSlashings

func (a *BeaconApiService) SubmitPoolProposerSlashings(ctx _context.Context, inlineObject3 InlineObject3) (*_nethttp.Response, error)

SubmitPoolProposerSlashings Submit ProposerSlashing object to node's pool Submits ProposerSlashing object to node&#39;s pool and if passes validation node MUST broadcast it to network.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param inlineObject3

func (*BeaconApiService) SubmitPoolVoluntaryExit

func (a *BeaconApiService) SubmitPoolVoluntaryExit(ctx _context.Context, inlineObject4 InlineObject4) (*_nethttp.Response, error)

SubmitPoolVoluntaryExit Submit SignedVoluntaryExit object to node's pool Submits SignedVoluntaryExit object to node&#39;s pool and if passes validation node MUST broadcast it to network.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param inlineObject4

type BeaconBlock

type BeaconBlock struct {
	Slot          string                `json:"slot,omitempty"`
	ProposerIndex string                `json:"proposer_index,omitempty"`
	ParentRoot    string                `json:"parent_root,omitempty"`
	StateRoot     string                `json:"state_root,omitempty"`
	Body          BeaconBlockAllOf1Body `json:"body,omitempty"`
}

BeaconBlock The [`BeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec.

type BeaconBlockAllOf

type BeaconBlockAllOf struct {
	Slot          string `json:"slot,omitempty"`
	ProposerIndex string `json:"proposer_index,omitempty"`
	ParentRoot    string `json:"parent_root,omitempty"`
	StateRoot     string `json:"state_root,omitempty"`
}

BeaconBlockAllOf struct for BeaconBlockAllOf

type BeaconBlockAllOf1

type BeaconBlockAllOf1 struct {
	Body BeaconBlockAllOf1Body `json:"body,omitempty"`
}

BeaconBlockAllOf1 struct for BeaconBlockAllOf1

type BeaconBlockAllOf1Body

type BeaconBlockAllOf1Body struct {
	RandaoReveal      string                                 `json:"randao_reveal,omitempty"`
	Eth1Data          GetStateResponseDataEth1Data           `json:"eth1_data,omitempty"`
	Graffiti          string                                 `json:"graffiti,omitempty"`
	ProposerSlashings []GetPoolProposerSlashingsResponseData `json:"proposer_slashings,omitempty"`
	AttesterSlashings []GetPoolAttesterSlashingsResponseData `json:"attester_slashings,omitempty"`
	Attestations      []GetBlockAttestationsResponseData1    `json:"attestations,omitempty"`
	Deposits          []BeaconBlockAllOf1BodyDeposits        `json:"deposits,omitempty"`
	VoluntaryExits    []GetPoolVoluntaryExitsResponseMessage `json:"voluntary_exits,omitempty"`
}

BeaconBlockAllOf1Body The [`BeaconBlockBody`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblockbody) object from the Eth2.0 spec.

type BeaconBlockAllOf1BodyData

type BeaconBlockAllOf1BodyData struct {
	// The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._
	Pubkey                string `json:"pubkey,omitempty"`
	WithdrawalCredentials string `json:"withdrawal_credentials,omitempty"`
	Amount                string `json:"amount,omitempty"`
	Signature             string `json:"signature,omitempty"`
}

BeaconBlockAllOf1BodyData The [`DepositData`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#depositdata) object from the Eth2.0 spec.

type BeaconBlockAllOf1BodyDeposits

type BeaconBlockAllOf1BodyDeposits struct {
	// Branch in the deposit tree.
	Proof []string                  `json:"proof,omitempty"`
	Data  BeaconBlockAllOf1BodyData `json:"data,omitempty"`
}

BeaconBlockAllOf1BodyDeposits The [`Deposit`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#deposit) object from the Eth2.0 spec.

type BeaconState added in v0.3.0

type BeaconState struct {
	GenesisTime           string                   `json:"genesis_time,omitempty"`
	GenesisValidatorsRoot string                   `json:"genesis_validators_root,omitempty"`
	Slot                  string                   `json:"slot,omitempty"`
	Fork                  GetStateForkResponseData `json:"fork,omitempty"`
	// The [`BeaconBlockHeader`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblockheader) object from the Eth2.0 spec.
	LatestBlockHeader map[string]interface{}       `json:"latest_block_header,omitempty"`
	BlockRoots        []string                     `json:"block_roots,omitempty"`
	StateRoots        []string                     `json:"state_roots,omitempty"`
	HistoricalRoots   []string                     `json:"historical_roots,omitempty"`
	Eth1Data          GetStateResponseDataEth1Data `json:"eth1_data,omitempty"`
	Eth1DataVotes     []map[string]interface{}     `json:"eth1_data_votes,omitempty"`
	Eth1DepositIndex  string                       `json:"eth1_deposit_index,omitempty"`
	Validators        []map[string]interface{}     `json:"validators,omitempty"`
	// Validator balances in gwei
	Balances    []string `json:"balances,omitempty"`
	RandaoMixes []string `json:"randao_mixes,omitempty"`
	// Per-epoch sums of slashed effective balances
	Slashings                 []string                 `json:"slashings,omitempty"`
	PreviousEpochAttestations []map[string]interface{} `json:"previous_epoch_attestations,omitempty"`
	CurrentEpochAttestations  []map[string]interface{} `json:"current_epoch_attestations,omitempty"`
	// Bit set for every recent justified epoch
	JustificationBits           string                                                   `json:"justification_bits,omitempty"`
	PreviousJustifiedCheckpoint GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"previous_justified_checkpoint,omitempty"`
	CurrentJustifiedCheckpoint  GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"current_justified_checkpoint,omitempty"`
	FinalizedCheckpoint         GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"finalized_checkpoint,omitempty"`
}

BeaconState The [`BeaconState`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec.

type Checkpoint

type Checkpoint struct {
	Epoch string `json:"epoch,omitempty"`
	Root  string `json:"root,omitempty"`
}

Checkpoint The [`Checkpoint`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#checkpoint

type Committee

type Committee struct {
	Index string `json:"index,omitempty"`
	Slot  string `json:"slot,omitempty"`
	// List of validator indices assigned to this committee
	Validators []string `json:"validators,omitempty"`
}

Committee Group of validators assigned to attest at specific slot and that have the same committee index (shard in phase 1)

type ConfigApiService

type ConfigApiService service

ConfigApiService ConfigApi service

func (*ConfigApiService) GetDepositContract

GetDepositContract Get deposit contract address. Retrieve deposit contract address and genesis fork version.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetDepositContractResponse

func (*ConfigApiService) GetForkSchedule

GetForkSchedule Get scheduled upcoming forks. Retrieve all scheduled upcoming forks this node is aware of.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetForkScheduleResponse

func (*ConfigApiService) GetSpec

GetSpec Get spec params. Retrieve specification configuration (without Phase 1 params) used on this node. [Specification params list](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/configs/mainnet.yaml) Values are returned with following format: - any value starting with 0x in the spec is returned as a hex string - all other values are returned as number

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetSpecResponse

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type DebugApiService added in v0.3.0

type DebugApiService service

DebugApiService DebugApi service

func (*DebugApiService) GetDebugChainHeads added in v0.3.0

GetDebugChainHeads Get fork choice leaves Retrieves all possible chain heads (leaves of fork choice tree).

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetDebugChainHeadsResponse

func (*DebugApiService) GetState added in v0.3.0

GetState Get full BeaconState object Returns full BeaconState object for given stateId.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param stateId State identifier. Can be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.

@return GetStateResponse

type ErrorMessage added in v0.3.0

type ErrorMessage struct {
	// Either specific error code in case of invalid request or http status code
	Code float32 `json:"code,omitempty"`
	// Message describing error
	Message string `json:"message,omitempty"`
	// Optional stacktraces, sent when node is in debug mode
	Stacktraces []string `json:"stacktraces,omitempty"`
}

ErrorMessage struct for ErrorMessage

type EventsApiService added in v0.3.0

type EventsApiService service

EventsApiService EventsApi service

func (*EventsApiService) Eventstream added in v0.3.0

func (a *EventsApiService) Eventstream(ctx _context.Context, topics []string) (string, *_nethttp.Response, error)

Eventstream Subscribe to beacon node events Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use [eventsource](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface) implementation to listen on those events.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param topics Event types to subscribe to

@return string

type Fork

type Fork struct {
	// a fork version number
	PreviousVersion string `json:"previous_version,omitempty"`
	// a fork version number
	CurrentVersion string `json:"current_version,omitempty"`
	Epoch          string `json:"epoch,omitempty"`
}

Fork The [`Fork`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#fork) object from the Eth2.0 spec.

type GenericOpenAPIError

type GenericOpenAPIError struct {
	// contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type GenesisTime

type GenesisTime struct {
}

GenesisTime struct for GenesisTime

type GetAggregatedAttestationResponse added in v0.3.0

type GetAggregatedAttestationResponse struct {
	Data GetBlockAttestationsResponseData1 `json:"data,omitempty"`
}

GetAggregatedAttestationResponse struct for GetAggregatedAttestationResponse

type GetAttesterDutiesResponse added in v0.3.0

type GetAttesterDutiesResponse struct {
	Data []GetAttesterDutiesResponseData `json:"data,omitempty"`
}

GetAttesterDutiesResponse struct for GetAttesterDutiesResponse

type GetAttesterDutiesResponseData added in v0.3.0

type GetAttesterDutiesResponseData struct {
	// The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._
	Pubkey                  string `json:"pubkey,omitempty"`
	CommitteeIndex          string `json:"committee_index,omitempty"`
	CommitteeLength         string `json:"committee_length,omitempty"`
	ValidatorCommitteeIndex string `json:"validator_committee_index,omitempty"`
	Slot                    string `json:"slot,omitempty"`
}

GetAttesterDutiesResponseData struct for GetAttesterDutiesResponseData

type GetBlockAttestationsResponse added in v0.3.0

type GetBlockAttestationsResponse struct {
	Data []GetBlockAttestationsResponseData1 `json:"data,omitempty"`
}

GetBlockAttestationsResponse struct for GetBlockAttestationsResponse

type GetBlockAttestationsResponseData added in v0.3.0

type GetBlockAttestationsResponseData struct {
	Slot            string                                                   `json:"slot,omitempty"`
	Index           string                                                   `json:"index,omitempty"`
	BeaconBlockRoot string                                                   `json:"beacon_block_root,omitempty"`
	Source          GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"source,omitempty"`
	Target          GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"target,omitempty"`
}

GetBlockAttestationsResponseData The [`AttestationData`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#attestationdata) object from the Eth2.0 spec.

type GetBlockAttestationsResponseData1 added in v0.3.0

type GetBlockAttestationsResponseData1 struct {
	// Attester aggregation bits.
	AggregationBits string                           `json:"aggregation_bits,omitempty"`
	Signature       string                           `json:"signature,omitempty"`
	Data            GetBlockAttestationsResponseData `json:"data,omitempty"`
}

GetBlockAttestationsResponseData1 The [`Attestation`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#attestation) object from the Eth2.0 spec.

type GetBlockHeaderResponse added in v0.3.0

type GetBlockHeaderResponse struct {
	Data GetBlockHeadersResponseData `json:"data,omitempty"`
}

GetBlockHeaderResponse struct for GetBlockHeaderResponse

type GetBlockHeadersOpts

type GetBlockHeadersOpts struct {
	Slot       optional.Interface
	ParentRoot optional.Interface
}

GetBlockHeadersOpts Optional parameters for the method 'GetBlockHeaders'

type GetBlockHeadersResponse added in v0.3.0

type GetBlockHeadersResponse struct {
	Data []GetBlockHeadersResponseData `json:"data,omitempty"`
}

GetBlockHeadersResponse struct for GetBlockHeadersResponse

type GetBlockHeadersResponseData added in v0.3.0

type GetBlockHeadersResponseData struct {
	Root      string                        `json:"root,omitempty"`
	Canonical bool                          `json:"canonical,omitempty"`
	Header    GetBlockHeadersResponseHeader `json:"header,omitempty"`
}

GetBlockHeadersResponseData struct for GetBlockHeadersResponseData

type GetBlockHeadersResponseHeader added in v0.3.0

type GetBlockHeadersResponseHeader struct {
	// The [`BeaconBlockHeader`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblockheader) object from the Eth2.0 spec.
	Message   map[string]interface{} `json:"message,omitempty"`
	Signature string                 `json:"signature,omitempty"`
}

GetBlockHeadersResponseHeader The [`SignedBeaconBlockHeader`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedbeaconblockheader) object envelope from the Eth2.0 spec.

type GetBlockResponse added in v0.3.0

type GetBlockResponse struct {
	Data GetBlockResponseData `json:"data,omitempty"`
}

GetBlockResponse struct for GetBlockResponse

type GetBlockResponseData added in v0.3.0

type GetBlockResponseData struct {
	// The [`BeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec.
	Message   map[string]interface{} `json:"message,omitempty"`
	Signature string                 `json:"signature,omitempty"`
}

GetBlockResponseData The [`SignedBeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedbeaconblock) object envelope from the Eth2.0 spec.

type GetBlockRootResponse added in v0.3.0

type GetBlockRootResponse struct {
	Data GetBlockRootResponseData `json:"data,omitempty"`
}

GetBlockRootResponse struct for GetBlockRootResponse

type GetBlockRootResponseData added in v0.3.0

type GetBlockRootResponseData struct {
	Root interface{} `json:"root,omitempty"`
}

GetBlockRootResponseData struct for GetBlockRootResponseData

type GetDebugChainHeadsResponse added in v0.3.0

type GetDebugChainHeadsResponse struct {
	Data []GetDebugChainHeadsResponseData `json:"data,omitempty"`
}

GetDebugChainHeadsResponse struct for GetDebugChainHeadsResponse

type GetDebugChainHeadsResponseData added in v0.3.0

type GetDebugChainHeadsResponseData struct {
	Root string `json:"root,omitempty"`
	Slot string `json:"slot,omitempty"`
}

GetDebugChainHeadsResponseData struct for GetDebugChainHeadsResponseData

type GetDepositContractResponse added in v0.3.0

type GetDepositContractResponse struct {
	Data GetDepositContractResponseData `json:"data,omitempty"`
}

GetDepositContractResponse struct for GetDepositContractResponse

type GetDepositContractResponseData added in v0.3.0

type GetDepositContractResponseData struct {
	// Id of Eth1 chain on which contract is deployed.
	ChainId int32  `json:"chain_id,omitempty"`
	Address string `json:"address,omitempty"`
}

GetDepositContractResponseData struct for GetDepositContractResponseData

type GetEpochCommitteesOpts

type GetEpochCommitteesOpts struct {
	Index optional.Interface
	Slot  optional.Interface
}

GetEpochCommitteesOpts Optional parameters for the method 'GetEpochCommittees'

type GetEpochCommitteesResponse added in v0.3.0

type GetEpochCommitteesResponse struct {
	Data []GetEpochCommitteesResponseData `json:"data,omitempty"`
}

GetEpochCommitteesResponse struct for GetEpochCommitteesResponse

type GetEpochCommitteesResponseData added in v0.3.0

type GetEpochCommitteesResponseData struct {
	Index string `json:"index,omitempty"`
	Slot  string `json:"slot,omitempty"`
	// List of validator indices assigned to this committee
	Validators []string `json:"validators,omitempty"`
}

GetEpochCommitteesResponseData Group of validators assigned to attest at specific slot and that have the same committee index (shard in phase 1)

type GetForkScheduleResponse added in v0.3.0

type GetForkScheduleResponse struct {
	Data []GetStateForkResponseData `json:"data,omitempty"`
}

GetForkScheduleResponse struct for GetForkScheduleResponse

type GetGenesisResponse added in v0.3.0

type GetGenesisResponse struct {
	Data GetGenesisResponseData `json:"data,omitempty"`
}

GetGenesisResponse struct for GetGenesisResponse

type GetGenesisResponseData added in v0.3.0

type GetGenesisResponseData struct {
	GenesisTime           string `json:"genesis_time,omitempty"`
	GenesisValidatorsRoot string `json:"genesis_validators_root,omitempty"`
	// a fork version number
	GenesisForkVersion string `json:"genesis_fork_version,omitempty"`
}

GetGenesisResponseData struct for GetGenesisResponseData

type GetNetworkIdentityResponse added in v0.3.0

type GetNetworkIdentityResponse struct {
	Data GetNetworkIdentityResponseData `json:"data,omitempty"`
}

GetNetworkIdentityResponse struct for GetNetworkIdentityResponse

type GetNetworkIdentityResponseData added in v0.3.0

type GetNetworkIdentityResponseData struct {
	// Cryptographic hash of a peer’s public key. [Read more](https://docs.libp2p.io/concepts/peer-id/)
	PeerId string `json:"peer_id,omitempty"`
	// Ethereum node record. [Read more](https://eips.ethereum.org/EIPS/eip-778)
	Enr                string                                 `json:"enr,omitempty"`
	P2pAddresses       []string                               `json:"p2p_addresses,omitempty"`
	DiscoveryAddresses []string                               `json:"discovery_addresses,omitempty"`
	Metadata           GetNetworkIdentityResponseDataMetadata `json:"metadata,omitempty"`
}

GetNetworkIdentityResponseData struct for GetNetworkIdentityResponseData

type GetNetworkIdentityResponseDataMetadata added in v0.3.0

type GetNetworkIdentityResponseDataMetadata struct {
	SeqNumber interface{} `json:"seq_number,omitempty"`
	Attnets   interface{} `json:"attnets,omitempty"`
}

GetNetworkIdentityResponseDataMetadata Based on eth2 [Metadata object](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/p2p-interface.md#metadata)

type GetPeerResponse added in v0.3.0

type GetPeerResponse struct {
	Data GetPeersResponseData `json:"data,omitempty"`
}

GetPeerResponse struct for GetPeerResponse

type GetPeersResponse added in v0.3.0

type GetPeersResponse struct {
	Data []GetPeersResponseData `json:"data,omitempty"`
}

GetPeersResponse struct for GetPeersResponse

type GetPeersResponseData added in v0.3.0

type GetPeersResponseData struct {
	// Cryptographic hash of a peer’s public key. [Read more](https://docs.libp2p.io/concepts/peer-id/)
	PeerId string `json:"peer_id,omitempty"`
	// Ethereum node record. [Read more](https://eips.ethereum.org/EIPS/eip-778)
	Enr string `json:"enr,omitempty"`
	// [Read more](https://docs.libp2p.io/reference/glossary/#multiaddr)
	Address   string `json:"address,omitempty"`
	State     string `json:"state,omitempty"`
	Direction string `json:"direction,omitempty"`
}

GetPeersResponseData struct for GetPeersResponseData

type GetPoolAttestationsOpts

type GetPoolAttestationsOpts struct {
	Slot           optional.String
	CommitteeIndex optional.String
}

GetPoolAttestationsOpts Optional parameters for the method 'GetPoolAttestations'

type GetPoolAttesterSlashingsResponse added in v0.3.0

type GetPoolAttesterSlashingsResponse struct {
	Data []GetPoolAttesterSlashingsResponseData `json:"data,omitempty"`
}

GetPoolAttesterSlashingsResponse struct for GetPoolAttesterSlashingsResponse

type GetPoolAttesterSlashingsResponseAttestation1 added in v0.3.0

type GetPoolAttesterSlashingsResponseAttestation1 struct {
	// Attesting validator indices
	AttestingIndices []string                         `json:"attesting_indices,omitempty"`
	Signature        string                           `json:"signature,omitempty"`
	Data             GetBlockAttestationsResponseData `json:"data,omitempty"`
}

GetPoolAttesterSlashingsResponseAttestation1 The [`IndexedAttestation`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#indexedattestation) object from the Eth2.0 spec.

type GetPoolAttesterSlashingsResponseData added in v0.3.0

type GetPoolAttesterSlashingsResponseData struct {
	Attestation1 GetPoolAttesterSlashingsResponseAttestation1 `json:"attestation_1,omitempty"`
	Attestation2 GetPoolAttesterSlashingsResponseAttestation1 `json:"attestation_2,omitempty"`
}

GetPoolAttesterSlashingsResponseData The [`AttesterSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/core/0_beacon-chain.md#attesterslashing) object from the Eth2.0 spec.

type GetPoolProposerSlashingsResponse added in v0.3.0

type GetPoolProposerSlashingsResponse struct {
	Data []GetPoolProposerSlashingsResponseData `json:"data,omitempty"`
}

GetPoolProposerSlashingsResponse struct for GetPoolProposerSlashingsResponse

type GetPoolProposerSlashingsResponseData added in v0.3.0

type GetPoolProposerSlashingsResponseData struct {
	SignedHeader1 GetBlockHeadersResponseHeader `json:"signed_header_1,omitempty"`
	SignedHeader2 GetBlockHeadersResponseHeader `json:"signed_header_2,omitempty"`
}

GetPoolProposerSlashingsResponseData The [`ProposerSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#proposerslashing) object from the Eth2.0 spec.

type GetPoolVoluntaryExitsResponse added in v0.3.0

type GetPoolVoluntaryExitsResponse struct {
	Data []GetPoolVoluntaryExitsResponseData `json:"data,omitempty"`
}

GetPoolVoluntaryExitsResponse struct for GetPoolVoluntaryExitsResponse

type GetPoolVoluntaryExitsResponseData added in v0.3.0

type GetPoolVoluntaryExitsResponseData struct {
	Message   GetPoolVoluntaryExitsResponseMessage `json:"message,omitempty"`
	Signature string                               `json:"signature,omitempty"`
}

GetPoolVoluntaryExitsResponseData The [`SignedVoluntaryExit`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedvoluntaryexit) object from the Eth2.0 spec.

type GetPoolVoluntaryExitsResponseMessage added in v0.3.0

type GetPoolVoluntaryExitsResponseMessage struct {
	Epoch          string `json:"epoch,omitempty"`
	ValidatorIndex string `json:"validator_index,omitempty"`
}

GetPoolVoluntaryExitsResponseMessage The [`VoluntaryExit`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#voluntaryexit) object from the Eth2.0 spec.

type GetProposerDutiesResponse added in v0.3.0

type GetProposerDutiesResponse struct {
	Data []GetProposerDutiesResponseData `json:"data,omitempty"`
}

GetProposerDutiesResponse struct for GetProposerDutiesResponse

type GetProposerDutiesResponseData added in v0.3.0

type GetProposerDutiesResponseData struct {
	// The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._
	Pubkey string `json:"pubkey,omitempty"`
	Slot   string `json:"slot,omitempty"`
}

GetProposerDutiesResponseData struct for GetProposerDutiesResponseData

type GetSpecResponse added in v0.3.0

type GetSpecResponse struct {
	// Key value mapping of Phase 0[spec variables](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/configs/mainnet.yaml). Values are returned with following format:   - any value starting with 0x in the spec is returned as a hex string   - all other values are returned as number
	Data map[string]interface{} `json:"data,omitempty"`
}

GetSpecResponse struct for GetSpecResponse

type GetStateFinalityCheckpointsResponse added in v0.3.0

type GetStateFinalityCheckpointsResponse struct {
	Data GetStateFinalityCheckpointsResponseData `json:"data,omitempty"`
}

GetStateFinalityCheckpointsResponse struct for GetStateFinalityCheckpointsResponse

type GetStateFinalityCheckpointsResponseData added in v0.3.0

type GetStateFinalityCheckpointsResponseData struct {
	PreviousJustified GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"previous_justified,omitempty"`
	CurrentJustified  GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"current_justified,omitempty"`
	Finalized         GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"finalized,omitempty"`
}

GetStateFinalityCheckpointsResponseData struct for GetStateFinalityCheckpointsResponseData

type GetStateFinalityCheckpointsResponseDataPreviousJustified added in v0.3.0

type GetStateFinalityCheckpointsResponseDataPreviousJustified struct {
	Epoch string `json:"epoch,omitempty"`
	Root  string `json:"root,omitempty"`
}

GetStateFinalityCheckpointsResponseDataPreviousJustified The [`Checkpoint`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#checkpoint

type GetStateForkResponse added in v0.3.0

type GetStateForkResponse struct {
	Data GetStateForkResponseData `json:"data,omitempty"`
}

GetStateForkResponse struct for GetStateForkResponse

type GetStateForkResponseData added in v0.3.0

type GetStateForkResponseData struct {
	// a fork version number
	PreviousVersion string `json:"previous_version,omitempty"`
	// a fork version number
	CurrentVersion string `json:"current_version,omitempty"`
	Epoch          string `json:"epoch,omitempty"`
}

GetStateForkResponseData The [`Fork`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#fork) object from the Eth2.0 spec.

type GetStateResponse added in v0.3.0

type GetStateResponse struct {
	Data GetStateResponseData `json:"data,omitempty"`
}

GetStateResponse struct for GetStateResponse

type GetStateResponseData added in v0.3.0

type GetStateResponseData struct {
	GenesisTime           string                   `json:"genesis_time,omitempty"`
	GenesisValidatorsRoot string                   `json:"genesis_validators_root,omitempty"`
	Slot                  string                   `json:"slot,omitempty"`
	Fork                  GetStateForkResponseData `json:"fork,omitempty"`
	// The [`BeaconBlockHeader`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblockheader) object from the Eth2.0 spec.
	LatestBlockHeader map[string]interface{}       `json:"latest_block_header,omitempty"`
	BlockRoots        []string                     `json:"block_roots,omitempty"`
	StateRoots        []string                     `json:"state_roots,omitempty"`
	HistoricalRoots   []string                     `json:"historical_roots,omitempty"`
	Eth1Data          GetStateResponseDataEth1Data `json:"eth1_data,omitempty"`
	Eth1DataVotes     []map[string]interface{}     `json:"eth1_data_votes,omitempty"`
	Eth1DepositIndex  string                       `json:"eth1_deposit_index,omitempty"`
	Validators        []map[string]interface{}     `json:"validators,omitempty"`
	// Validator balances in gwei
	Balances    []string `json:"balances,omitempty"`
	RandaoMixes []string `json:"randao_mixes,omitempty"`
	// Per-epoch sums of slashed effective balances
	Slashings                 []string                 `json:"slashings,omitempty"`
	PreviousEpochAttestations []map[string]interface{} `json:"previous_epoch_attestations,omitempty"`
	CurrentEpochAttestations  []map[string]interface{} `json:"current_epoch_attestations,omitempty"`
	// Bit set for every recent justified epoch
	JustificationBits           string                                                   `json:"justification_bits,omitempty"`
	PreviousJustifiedCheckpoint GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"previous_justified_checkpoint,omitempty"`
	CurrentJustifiedCheckpoint  GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"current_justified_checkpoint,omitempty"`
	FinalizedCheckpoint         GetStateFinalityCheckpointsResponseDataPreviousJustified `json:"finalized_checkpoint,omitempty"`
}

GetStateResponseData The [`BeaconState`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec.

type GetStateResponseDataEth1Data added in v0.3.0

type GetStateResponseDataEth1Data struct {
	DepositRoot  string `json:"deposit_root,omitempty"`
	DepositCount string `json:"deposit_count,omitempty"`
	BlockHash    string `json:"block_hash,omitempty"`
}

GetStateResponseDataEth1Data The [`Eth1Data`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#eth1data) object from the Eth2.0 spec.

type GetStateRootResponse added in v0.3.0

type GetStateRootResponse struct {
	Data GetStateRootResponseData `json:"data,omitempty"`
}

GetStateRootResponse struct for GetStateRootResponse

type GetStateRootResponseData added in v0.3.0

type GetStateRootResponseData struct {
	Root string `json:"root,omitempty"`
}

GetStateRootResponseData struct for GetStateRootResponseData

type GetStateValidatorResponse added in v0.3.0

type GetStateValidatorResponse struct {
	Data GetStateValidatorsResponseData `json:"data,omitempty"`
}

GetStateValidatorResponse struct for GetStateValidatorResponse

type GetStateValidatorsOpts

type GetStateValidatorsOpts struct {
	Id     optional.Interface
	Status optional.Interface
}

GetStateValidatorsOpts Optional parameters for the method 'GetStateValidators'

type GetStateValidatorsResponse added in v0.3.0

type GetStateValidatorsResponse struct {
	Data []GetStateValidatorsResponseData `json:"data,omitempty"`
}

GetStateValidatorsResponse struct for GetStateValidatorsResponse

type GetStateValidatorsResponseData added in v0.3.0

type GetStateValidatorsResponseData struct {
	Index   string `json:"index,omitempty"`
	Balance string `json:"balance,omitempty"`
	// Possible statuses: - **pending_initialized** - When the first deposit is processed, but not enough funds are available (or not yet the end of the first epoch) to get validator into the activation queue. - **pending_queued** - When validator is waiting to get activated, and have enough funds etc. while in the queue, validator activation epoch keeps changing until it gets to the front and make it through (finalization is a requirement here too). - **active_ongoing** - When validator must be attesting, and have not initiated any exit. - **active_exiting** - When validator is still active, but filed a voluntary request to exit. - **active_slashed** - When validator is still active, but have a slashed status and is scheduled to exit. - **exited_unslashed** - When validator has reached reguler exit epoch, not being slashed, and doesn't have to attest any more, but cannot withdraw yet. - **exited_slashed** - When validator has reached reguler exit epoch, but was slashed, have to wait for a longer withdrawal period. - **withdrawal_possible** - After validator has exited, a while later is permitted to move funds, and is truly out of the system. - **withdrawal_done** - (not possible in phase0, except slashing full balance) - actually having moved funds away  [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
	Status    string                              `json:"status,omitempty"`
	Validator GetStateValidatorsResponseValidator `json:"validator,omitempty"`
}

GetStateValidatorsResponseData struct for GetStateValidatorsResponseData

type GetStateValidatorsResponseValidator added in v0.3.0

type GetStateValidatorsResponseValidator struct {
	// The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._
	Pubkey                string `json:"pubkey,omitempty"`
	WithdrawalCredentials string `json:"withdrawal_credentials,omitempty"`
	EffectiveBalance      string `json:"effective_balance,omitempty"`
	// Was validator slashed (not longer active).
	Slashed                    bool   `json:"slashed,omitempty"`
	ActivationEligibilityEpoch string `json:"activation_eligibility_epoch,omitempty"`
	ActivationEpoch            string `json:"activation_epoch,omitempty"`
	ExitEpoch                  string `json:"exit_epoch,omitempty"`
	WithdrawableEpoch          string `json:"withdrawable_epoch,omitempty"`
}

GetStateValidatorsResponseValidator struct for GetStateValidatorsResponseValidator

type GetSyncingStatusResponse added in v0.3.0

type GetSyncingStatusResponse struct {
	Data GetSyncingStatusResponseData `json:"data,omitempty"`
}

GetSyncingStatusResponse struct for GetSyncingStatusResponse

type GetSyncingStatusResponseData added in v0.3.0

type GetSyncingStatusResponseData struct {
	HeadSlot     interface{} `json:"head_slot,omitempty"`
	SyncDistance interface{} `json:"sync_distance,omitempty"`
}

GetSyncingStatusResponseData struct for GetSyncingStatusResponseData

type GetVersionResponse added in v0.3.0

type GetVersionResponse struct {
	Data GetVersionResponseData `json:"data,omitempty"`
}

GetVersionResponse struct for GetVersionResponse

type GetVersionResponseData added in v0.3.0

type GetVersionResponseData struct {
	// A string which uniquely identifies the client implementation and its version; similar to [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3).
	Version string `json:"version,omitempty"`
}

GetVersionResponseData struct for GetVersionResponseData

type InlineObject

type InlineObject struct {
	CommitteeIndex string `json:"committee_index,omitempty"`
	Slot           string `json:"slot,omitempty"`
	// Signals to BN that a validator on the VC has been chosed for aggregator role.
	IsAggregator bool `json:"is_aggregator,omitempty"`
}

InlineObject struct for InlineObject

type InlineObject1

type InlineObject1 struct {
	// Attester aggregation bits.
	AggregationBits string                           `json:"aggregation_bits,omitempty"`
	Signature       string                           `json:"signature,omitempty"`
	Data            GetBlockAttestationsResponseData `json:"data,omitempty"`
}

InlineObject1 The [`Attestation`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#attestation) object from the Eth2.0 spec.

type InlineObject2

type InlineObject2 struct {
	Attestation1 GetPoolAttesterSlashingsResponseAttestation1 `json:"attestation_1,omitempty"`
	Attestation2 GetPoolAttesterSlashingsResponseAttestation1 `json:"attestation_2,omitempty"`
}

InlineObject2 The [`AttesterSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/core/0_beacon-chain.md#attesterslashing) object from the Eth2.0 spec.

type InlineObject3

type InlineObject3 struct {
	SignedHeader1 GetBlockHeadersResponseHeader `json:"signed_header_1,omitempty"`
	SignedHeader2 GetBlockHeadersResponseHeader `json:"signed_header_2,omitempty"`
}

InlineObject3 The [`ProposerSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#proposerslashing) object from the Eth2.0 spec.

type InlineObject4 added in v0.3.0

type InlineObject4 struct {
	Message   GetPoolVoluntaryExitsResponseMessage `json:"message,omitempty"`
	Signature string                               `json:"signature,omitempty"`
}

InlineObject4 The [`SignedVoluntaryExit`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedvoluntaryexit) object from the Eth2.0 spec.

type InlineObject5 added in v0.3.0

type InlineObject5 struct {
	Data []map[string]interface{} `json:"data,omitempty"`
}

InlineObject5 struct for InlineObject5

type InlineResponse400 added in v0.3.0

type InlineResponse400 struct {
	// Either specific error code in case of invalid request or http status code
	Code float32 `json:"code,omitempty"`
	// Message describing error
	Message string `json:"message,omitempty"`
	// Optional stacktraces, sent when node is in debug mode
	Stacktraces []string `json:"stacktraces,omitempty"`
}

InlineResponse400 struct for InlineResponse400

type InlineResponse500 added in v0.3.0

type InlineResponse500 struct {
	// Either specific error code in case of invalid request or http status code
	Code float32 `json:"code,omitempty"`
	// Message describing error
	Message string `json:"message,omitempty"`
	// Optional stacktraces, sent when node is in debug mode
	Stacktraces []string `json:"stacktraces,omitempty"`
}

InlineResponse500 struct for InlineResponse500

type NetworkIdentity

type NetworkIdentity struct {
	// Cryptographic hash of a peer’s public key. [Read more](https://docs.libp2p.io/concepts/peer-id/)
	PeerId string `json:"peer_id,omitempty"`
	// Ethereum node record. [Read more](https://eips.ethereum.org/EIPS/eip-778)
	Enr                string                                 `json:"enr,omitempty"`
	P2pAddresses       []string                               `json:"p2p_addresses,omitempty"`
	DiscoveryAddresses []string                               `json:"discovery_addresses,omitempty"`
	Metadata           GetNetworkIdentityResponseDataMetadata `json:"metadata,omitempty"`
}

NetworkIdentity struct for NetworkIdentity

type NodeApiService

type NodeApiService service

NodeApiService NodeApi service

func (*NodeApiService) GetHealth

func (a *NodeApiService) GetHealth(ctx _context.Context) (*_nethttp.Response, error)

GetHealth Get health check Returns node health status in http status codes. Useful for load balancers.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

func (*NodeApiService) GetNetworkIdentity

GetNetworkIdentity Get node network identity Retrieves data about the node&#39;s network presence

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetNetworkIdentityResponse

func (*NodeApiService) GetNodeVersion

GetNodeVersion Get version string of the running beacon node. Requests that the beacon node identify information about its implementation in a format similar to a [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) field.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetVersionResponse

func (*NodeApiService) GetPeer

GetPeer Get peer Retrieves data about the given peer

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param peerId

@return GetPeerResponse

func (*NodeApiService) GetPeers

GetPeers Get node network peers Retrieves data about the node&#39;s network peers

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetPeersResponse

func (*NodeApiService) GetSyncingStatus

GetSyncingStatus Get node syncing status Requests the beacon node to describe if it&#39;s currently syncing or not, and if it is, what block it is up to.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return GetSyncingStatusResponse

type Peer

type Peer struct {
	// Cryptographic hash of a peer’s public key. [Read more](https://docs.libp2p.io/concepts/peer-id/)
	PeerId string `json:"peer_id,omitempty"`
	// Ethereum node record. [Read more](https://eips.ethereum.org/EIPS/eip-778)
	Enr string `json:"enr,omitempty"`
	// [Read more](https://docs.libp2p.io/reference/glossary/#multiaddr)
	Address   string `json:"address,omitempty"`
	State     string `json:"state,omitempty"`
	Direction string `json:"direction,omitempty"`
}

Peer struct for Peer

type PrepareBeaconCommitteeSubnetOpts added in v0.3.0

type PrepareBeaconCommitteeSubnetOpts struct {
	InlineObject optional.Interface
}

PrepareBeaconCommitteeSubnetOpts Optional parameters for the method 'PrepareBeaconCommitteeSubnet'

type ProduceAttestationDataResponse added in v0.3.0

type ProduceAttestationDataResponse struct {
	Data GetBlockAttestationsResponseData `json:"data,omitempty"`
}

ProduceAttestationDataResponse struct for ProduceAttestationDataResponse

type ProduceBlockOpts added in v0.3.0

type ProduceBlockOpts struct {
	Graffiti optional.String
}

ProduceBlockOpts Optional parameters for the method 'ProduceBlock'

type ProduceBlockResponse added in v0.3.0

type ProduceBlockResponse struct {
	// The [`BeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec.
	Data map[string]interface{} `json:"data,omitempty"`
}

ProduceBlockResponse struct for ProduceBlockResponse

type ProposerDuty added in v0.3.0

type ProposerDuty struct {
	// The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._
	Pubkey string `json:"pubkey,omitempty"`
	Slot   string `json:"slot,omitempty"`
}

ProposerDuty struct for ProposerDuty

type ProposerSlashing

type ProposerSlashing struct {
	SignedHeader1 GetBlockHeadersResponseHeader `json:"signed_header_1,omitempty"`
	SignedHeader2 GetBlockHeadersResponseHeader `json:"signed_header_2,omitempty"`
}

ProposerSlashing The [`ProposerSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#proposerslashing) object from the Eth2.0 spec.

type PublishAggregateAndProofOpts added in v0.3.0

type PublishAggregateAndProofOpts struct {
	InlineObject5 optional.Interface
}

PublishAggregateAndProofOpts Optional parameters for the method 'PublishAggregateAndProof'

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type SignedAggregateAndProof

type SignedAggregateAndProof struct {
	Message   map[string]interface{} `json:"message,omitempty"`
	Signature string                 `json:"signature,omitempty"`
}

SignedAggregateAndProof The [`SignedAggregateAndProof`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/validator.md#signedaggregateandproof) object

type SignedBeaconBlock

type SignedBeaconBlock struct {
	// The [`BeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec.
	Message   map[string]interface{} `json:"message,omitempty"`
	Signature string                 `json:"signature,omitempty"`
}

SignedBeaconBlock The [`SignedBeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedbeaconblock) object envelope from the Eth2.0 spec.

type SignedBeaconBlockHeader

type SignedBeaconBlockHeader struct {
	// The [`BeaconBlockHeader`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#beaconblockheader) object from the Eth2.0 spec.
	Message   map[string]interface{} `json:"message,omitempty"`
	Signature string                 `json:"signature,omitempty"`
}

SignedBeaconBlockHeader The [`SignedBeaconBlockHeader`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedbeaconblockheader) object envelope from the Eth2.0 spec.

type SignedVoluntaryExit

type SignedVoluntaryExit struct {
	Message   GetPoolVoluntaryExitsResponseMessage `json:"message,omitempty"`
	Signature string                               `json:"signature,omitempty"`
}

SignedVoluntaryExit The [`SignedVoluntaryExit`](https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/beacon-chain.md#signedvoluntaryexit) object from the Eth2.0 spec.

type ValidatorApiService added in v0.3.0

type ValidatorApiService service

ValidatorApiService ValidatorApi service

func (*ValidatorApiService) GetAggregatedAttestation added in v0.3.0

func (a *ValidatorApiService) GetAggregatedAttestation(ctx _context.Context, attestationDataRoot string, slot string) (GetAggregatedAttestationResponse, *_nethttp.Response, error)

GetAggregatedAttestation Get aggregated attestation Aggregates all attestations matching given attestation data root and slot

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param attestationDataRoot HashTreeRoot of AttestationData that validator want's aggregated
  • @param slot

@return GetAggregatedAttestationResponse

func (*ValidatorApiService) GetAttesterDuties added in v0.3.0

func (a *ValidatorApiService) GetAttesterDuties(ctx _context.Context, epoch string, index []string) (GetAttesterDutiesResponse, *_nethttp.Response, error)

GetAttesterDuties Get attester duties Requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch. Duties should only need to be checked once per epoch, however a chain reorganization (of &gt; MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety, you should monitor chain reorganizations events.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param epoch Should only be allowed 1 epoch ahead
  • @param index Validator index

@return GetAttesterDutiesResponse

func (*ValidatorApiService) GetProposerDuties added in v0.3.0

GetProposerDuties Get block proposers duties Request beacon node to provide all validators that are suppose to propose block in given epoch

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param epoch

@return GetProposerDutiesResponse

func (*ValidatorApiService) PrepareBeaconCommitteeSubnet added in v0.3.0

func (a *ValidatorApiService) PrepareBeaconCommitteeSubnet(ctx _context.Context, localVarOptionals *PrepareBeaconCommitteeSubnetOpts) (*_nethttp.Response, error)

PrepareBeaconCommitteeSubnet Signal beacon node to prepare for a committee subnet After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary If validator &#x60;is_aggregator&#x60;, beacon node must: - announce subnet topic subscription on gossipsub - aggregate attestations received on that subnet

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *PrepareBeaconCommitteeSubnetOpts - Optional Parameters:
  • @param "InlineObject" (optional.Interface of []InlineObject) -

func (*ValidatorApiService) ProduceAttestationData added in v0.3.0

func (a *ValidatorApiService) ProduceAttestationData(ctx _context.Context, slot string, committeeIndex string) (ProduceAttestationDataResponse, *_nethttp.Response, error)

ProduceAttestationData Produce an attestation data Requests that the beacon node produce an AttestationData.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param slot The slot for which an attestation data should be created.
  • @param committeeIndex The committee index for which an attestation data should be created.

@return ProduceAttestationDataResponse

func (*ValidatorApiService) ProduceBlock added in v0.3.0

func (a *ValidatorApiService) ProduceBlock(ctx _context.Context, slot string, randaoReveal string, localVarOptionals *ProduceBlockOpts) (ProduceBlockResponse, *_nethttp.Response, error)

ProduceBlock Produce a new block, without signature. Requests a beacon node to produce a valid block, which can then be signed by a validator.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param slot The slot for which the block should be proposed.
  • @param randaoReveal The validator's randao reveal value.
  • @param optional nil or *ProduceBlockOpts - Optional Parameters:
  • @param "Graffiti" (optional.String) - Arbitrary data validator wants to include in block.

@return ProduceBlockResponse

func (*ValidatorApiService) PublishAggregateAndProof added in v0.3.0

func (a *ValidatorApiService) PublishAggregateAndProof(ctx _context.Context, localVarOptionals *PublishAggregateAndProofOpts) (*_nethttp.Response, error)

PublishAggregateAndProof Publish aggregate and proof Verifies given aggregate and proof and publishes it on appropriate gossipsub topic.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *PublishAggregateAndProofOpts - Optional Parameters:
  • @param "InlineObject5" (optional.Interface of InlineObject5) -

type ValidatorResponse

type ValidatorResponse struct {
	Index   string `json:"index,omitempty"`
	Balance string `json:"balance,omitempty"`
	// Possible statuses: - **pending_initialized** - When the first deposit is processed, but not enough funds are available (or not yet the end of the first epoch) to get validator into the activation queue. - **pending_queued** - When validator is waiting to get activated, and have enough funds etc. while in the queue, validator activation epoch keeps changing until it gets to the front and make it through (finalization is a requirement here too). - **active_ongoing** - When validator must be attesting, and have not initiated any exit. - **active_exiting** - When validator is still active, but filed a voluntary request to exit. - **active_slashed** - When validator is still active, but have a slashed status and is scheduled to exit. - **exited_unslashed** - When validator has reached reguler exit epoch, not being slashed, and doesn't have to attest any more, but cannot withdraw yet. - **exited_slashed** - When validator has reached reguler exit epoch, but was slashed, have to wait for a longer withdrawal period. - **withdrawal_possible** - After validator has exited, a while later is permitted to move funds, and is truly out of the system. - **withdrawal_done** - (not possible in phase0, except slashing full balance) - actually having moved funds away  [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
	Status    string                              `json:"status,omitempty"`
	Validator GetStateValidatorsResponseValidator `json:"validator,omitempty"`
}

ValidatorResponse struct for ValidatorResponse

type ValidatorStatus

type ValidatorStatus string

ValidatorStatus Possible statuses: - **pending_initialized** - When the first deposit is processed, but not enough funds are available (or not yet the end of the first epoch) to get validator into the activation queue. - **pending_queued** - When validator is waiting to get activated, and have enough funds etc. while in the queue, validator activation epoch keeps changing until it gets to the front and make it through (finalization is a requirement here too). - **active_ongoing** - When validator must be attesting, and have not initiated any exit. - **active_exiting** - When validator is still active, but filed a voluntary request to exit. - **active_slashed** - When validator is still active, but have a slashed status and is scheduled to exit. - **exited_unslashed** - When validator has reached reguler exit epoch, not being slashed, and doesn't have to attest any more, but cannot withdraw yet. - **exited_slashed** - When validator has reached reguler exit epoch, but was slashed, have to wait for a longer withdrawal period. - **withdrawal_possible** - After validator has exited, a while later is permitted to move funds, and is truly out of the system. - **withdrawal_done** - (not possible in phase0, except slashing full balance) - actually having moved funds away [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)

const (
	PENDING_INITIALIZED ValidatorStatus = "pending_initialized"
	PENDING_QUEUED      ValidatorStatus = "pending_queued"
	ACTIVE_ONGOING      ValidatorStatus = "active_ongoing"
	ACTIVE_EXITING      ValidatorStatus = "active_exiting"
	ACTIVE_SLASHED      ValidatorStatus = "active_slashed"
	EXITED_UNSLASHED    ValidatorStatus = "exited_unslashed"
	EXITED_SLASHED      ValidatorStatus = "exited_slashed"
	WITHDRAWAL_POSSIBLE ValidatorStatus = "withdrawal_possible"
	WITHDRAWAL_DONE     ValidatorStatus = "withdrawal_done"
)

List of ValidatorStatus

Source Files

Jump to

Keyboard shortcuts

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