eth2spec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 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 /v1/beacon/blocks/{block_id} Get block
BeaconApi GetBlockAttestations Get /v1/beacon/blocks/{block_id}/attestations Get block attestations
BeaconApi GetBlockHeader Get /v1/beacon/headers/{block_id} Get block header
BeaconApi GetBlockHeaders Get /v1/beacon/headers Get block headers
BeaconApi GetBlockRoot Get /v1/beacon/blocks/{block_id}/root Get block root
BeaconApi GetEpochCommittees Get /v1/beacon/states/{state_id}/committees/{epoch} Get all committees for epoch
BeaconApi GetGenesis Get /v1/beacon/genesis Retrieve details of the chain's genesis.
BeaconApi GetPoolAttestations Get /v1/beacon/pool/attestations Get Attestations from operations pool
BeaconApi GetPoolAttesterSlashings Get /v1/beacon/pool/atttester_slashings Get AttesterSlashings from operations pool
BeaconApi GetPoolProposerSlashings Get /v1/beacon/pool/proposer_slashings Get ProposerSlashings from operations pool
BeaconApi GetPoolVoluntaryExits Get /v1/beacon/pool/voluntary_exits Get SignedVoluntaryExit from operations pool
BeaconApi GetStateFinalityCheckpoints Get /v1/beacon/states/{state_id}/finality_checkpoints Get state finality checkpoints
BeaconApi GetStateFork Get /v1/beacon/states/{state_id}/fork Get Fork object for requested state
BeaconApi GetStateRoot Get /v1/beacon/states/{state_id}/root Get state SSZ HashTreeRoot
BeaconApi GetStateValidator Get /v1/beacon/states/{state_id}/validators/{validator_id} Get validator from state by id
BeaconApi GetStateValidators Get /v1/beacon/states/{state_id}/validators Get validators from state
BeaconApi SubmitPoolAttestations Post /v1/beacon/pool/attestations Submit Attestation object to node
BeaconApi SubmitPoolAttesterSlashings Post /v1/beacon/pool/atttester_slashings Submit AttesterSlashing object to node's pool
BeaconApi SubmitPoolProposerSlashings Post /v1/beacon/pool/proposer_slashings Submit ProposerSlashing object to node's pool
BeaconApi SubmitPoolVoluntaryExit Post /v1/beacon/pool/voluntary_exits Submit SignedVoluntaryExit object to node's pool
ConfigApi GetDepositContract Get /v1/config/deposit_contract Get deposit contract address.
ConfigApi GetForkSchedule Get /v1/config/fork_schedule Get scheduled upcoming forks.
ConfigApi GetSpec Get /v1/config/spec Get spec params.
NodeApi GetHealth Get /v1/node/health Get health check
NodeApi GetNetworkIdentity Get /v1/node/identity Get node network identity
NodeApi GetNodeVersion Get /v1/node/version Get version string of the running beacon node.
NodeApi GetPeer Get /v1/node/peers/{peer_id} Get peer
NodeApi GetPeers Get /v1/node/peers Get node network peers
NodeApi GetSyncingStatus Get /v1/node/syncing Get node syncing status
ValidatorRequiredApiApi GetGenesis Get /v1/beacon/genesis Retrieve details of the chain's genesis.
ValidatorRequiredApiApi GetStateFork Get /v1/beacon/states/{state_id}/fork Get Fork object for requested state
ValidatorRequiredApiApi GetStateValidator Get /v1/beacon/states/{state_id}/validators/{validator_id} Get validator from state by id
ValidatorRequiredApiApi GetSyncingStatus Get /v1/node/syncing Get node syncing status
ValidatorRequiredApiApi SubmitPoolAttestations Post /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

	NodeApi *NodeApiService

	ValidatorRequiredApiApi *ValidatorRequiredApiApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Eth2 Beacon Node API API vDev - Eth2Spec v0.11.1 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            InlineResponse20011Data `json:"data,omitempty"`
}

Attestation The [`Attestation`](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#attestation) 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._
	ValidatorPubkey  string `json:"validator_pubkey,omitempty"`
	AggregatorModulo string `json:"aggregator_modulo,omitempty"`
	AttestationSlot  string `json:"attestation_slot,omitempty"`
	CommitteeIndex   string `json:"committee_index,omitempty"`
}

AttesterDuty struct for AttesterDuty

type AttesterSlashing

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

AttesterSlashing The [`AttesterSlashing`](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/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 InlineResponse2009

func (*BeaconApiService) GetBlockAttestations

func (a *BeaconApiService) GetBlockAttestations(ctx _context.Context, blockId string) (InlineResponse20011, *_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 InlineResponse20011

func (*BeaconApiService) GetBlockHeader

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

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 InlineResponse2008

func (*BeaconApiService) GetBlockHeaders

func (a *BeaconApiService) GetBlockHeaders(ctx _context.Context, localVarOptionals *GetBlockHeadersOpts) (InlineResponse2007, *_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 InlineResponse2007

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 InlineResponse20010

func (*BeaconApiService) GetEpochCommittees

func (a *BeaconApiService) GetEpochCommittees(ctx _context.Context, stateId string, epoch string, localVarOptionals *GetEpochCommitteesOpts) (InlineResponse2006, *_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 InlineResponse2006

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 InlineResponse200

func (*BeaconApiService) GetPoolAttestations

func (a *BeaconApiService) GetPoolAttestations(ctx _context.Context, localVarOptionals *GetPoolAttestationsOpts) (InlineResponse20011, *_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 InlineResponse20011

func (*BeaconApiService) GetPoolAttesterSlashings

func (a *BeaconApiService) GetPoolAttesterSlashings(ctx _context.Context) (InlineResponse20012, *_nethttp.Response, error)

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 InlineResponse20012

func (*BeaconApiService) GetPoolProposerSlashings

func (a *BeaconApiService) GetPoolProposerSlashings(ctx _context.Context) (InlineResponse20013, *_nethttp.Response, error)

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 InlineResponse20013

func (*BeaconApiService) GetPoolVoluntaryExits

func (a *BeaconApiService) GetPoolVoluntaryExits(ctx _context.Context) (InlineResponse20014, *_nethttp.Response, error)

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 InlineResponse20014

func (*BeaconApiService) GetStateFinalityCheckpoints

func (a *BeaconApiService) GetStateFinalityCheckpoints(ctx _context.Context, stateId string) (InlineResponse2003, *_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 InlineResponse2003

func (*BeaconApiService) GetStateFork

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

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 InlineResponse2002

func (*BeaconApiService) GetStateRoot

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

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 InlineResponse2001

func (*BeaconApiService) GetStateValidator

func (a *BeaconApiService) GetStateValidator(ctx _context.Context, stateId string, validatorId string) (InlineResponse2005, *_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 InlineResponse2005

func (*BeaconApiService) GetStateValidators

func (a *BeaconApiService) GetStateValidators(ctx _context.Context, stateId string, localVarOptionals *GetStateValidatorsOpts) (InlineResponse2004, *_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 InlineResponse2004

func (*BeaconApiService) SubmitPoolAttestations

func (a *BeaconApiService) SubmitPoolAttestations(ctx _context.Context, inlineObject InlineObject) (*_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 inlineObject

func (*BeaconApiService) SubmitPoolAttesterSlashings

func (a *BeaconApiService) SubmitPoolAttesterSlashings(ctx _context.Context, inlineObject1 InlineObject1) (*_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 inlineObject1

func (*BeaconApiService) SubmitPoolProposerSlashings

func (a *BeaconApiService) SubmitPoolProposerSlashings(ctx _context.Context, inlineObject2 InlineObject2) (*_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 inlineObject2

func (*BeaconApiService) SubmitPoolVoluntaryExit

func (a *BeaconApiService) SubmitPoolVoluntaryExit(ctx _context.Context, inlineObject3 InlineObject3) (*_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 inlineObject3

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.11.1/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          BeaconBlockAllOf1BodyEth1Data   `json:"eth1_data,omitempty"`
	Graffiti          string                          `json:"graffiti,omitempty"`
	ProposerSlashings []InlineResponse20013Data       `json:"proposer_slashings,omitempty"`
	AttesterSlashings []InlineResponse20012Data       `json:"attester_slashings,omitempty"`
	Attestations      []InlineResponse20011Data1      `json:"attestations,omitempty"`
	Deposits          []BeaconBlockAllOf1BodyDeposits `json:"deposits,omitempty"`
	VoluntaryExits    []InlineResponse20014Message    `json:"voluntary_exits,omitempty"`
}

BeaconBlockAllOf1Body The [`BeaconBlockBody`](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/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.11.1/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.11.1/specs/phase0/beacon-chain.md#deposit) object from the Eth2.0 spec.

type BeaconBlockAllOf1BodyEth1Data

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

BeaconBlockAllOf1BodyEth1Data The [`Eth1Data`](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#eth1data) 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.11.1/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 InlineResponse20022

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 InlineResponse20020

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 InlineResponse20021

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 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.11.1/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 GetBlockHeadersOpts

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

GetBlockHeadersOpts Optional parameters for the method 'GetBlockHeaders'

type GetEpochCommitteesOpts

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

GetEpochCommitteesOpts Optional parameters for the method 'GetEpochCommittees'

type GetPoolAttestationsOpts

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

GetPoolAttestationsOpts Optional parameters for the method 'GetPoolAttestations'

type GetStateValidatorsOpts

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

GetStateValidatorsOpts Optional parameters for the method 'GetStateValidators'

type InlineObject

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

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

type InlineObject1

type InlineObject1 struct {
	Attestation1 InlineResponse20012Attestation1 `json:"attestation_1,omitempty"`
	Attestation2 InlineResponse20012Attestation1 `json:"attestation_2,omitempty"`
}

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

type InlineObject2

type InlineObject2 struct {
	SignedHeader1 InlineResponse2007Header `json:"signed_header_1,omitempty"`
	SignedHeader2 InlineResponse2007Header `json:"signed_header_2,omitempty"`
}

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

type InlineObject3

type InlineObject3 struct {
	Message   InlineResponse20014Message `json:"message,omitempty"`
	Signature string                     `json:"signature,omitempty"`
}

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

type InlineResponse200

type InlineResponse200 struct {
	Data InlineResponse200Data `json:"data,omitempty"`
}

InlineResponse200 struct for InlineResponse200

type InlineResponse2001

type InlineResponse2001 struct {
	Data InlineResponse2001Data `json:"data,omitempty"`
}

InlineResponse2001 struct for InlineResponse2001

type InlineResponse20010

type InlineResponse20010 struct {
	Data InlineResponse20010Data `json:"data,omitempty"`
}

InlineResponse20010 struct for InlineResponse20010

type InlineResponse20010Data

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

InlineResponse20010Data struct for InlineResponse20010Data

type InlineResponse20011

type InlineResponse20011 struct {
	Data []InlineResponse20011Data1 `json:"data,omitempty"`
}

InlineResponse20011 struct for InlineResponse20011

type InlineResponse20011Data

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

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

type InlineResponse20011Data1

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

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

type InlineResponse20012

type InlineResponse20012 struct {
	Data []InlineResponse20012Data `json:"data,omitempty"`
}

InlineResponse20012 struct for InlineResponse20012

type InlineResponse20012Attestation1

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

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

type InlineResponse20012Data

type InlineResponse20012Data struct {
	Attestation1 InlineResponse20012Attestation1 `json:"attestation_1,omitempty"`
	Attestation2 InlineResponse20012Attestation1 `json:"attestation_2,omitempty"`
}

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

type InlineResponse20013

type InlineResponse20013 struct {
	Data []InlineResponse20013Data `json:"data,omitempty"`
}

InlineResponse20013 struct for InlineResponse20013

type InlineResponse20013Data

type InlineResponse20013Data struct {
	SignedHeader1 InlineResponse2007Header `json:"signed_header_1,omitempty"`
	SignedHeader2 InlineResponse2007Header `json:"signed_header_2,omitempty"`
}

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

type InlineResponse20014

type InlineResponse20014 struct {
	Data []InlineResponse20014Data `json:"data,omitempty"`
}

InlineResponse20014 struct for InlineResponse20014

type InlineResponse20014Data

type InlineResponse20014Data struct {
	Message   InlineResponse20014Message `json:"message,omitempty"`
	Signature string                     `json:"signature,omitempty"`
}

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

type InlineResponse20014Message

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

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

type InlineResponse20015

type InlineResponse20015 struct {
	Data InlineResponse20015Data `json:"data,omitempty"`
}

InlineResponse20015 struct for InlineResponse20015

type InlineResponse20015Data

type InlineResponse20015Data 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           InlineResponse20015DataMetadata `json:"metadata,omitempty"`
}

InlineResponse20015Data struct for InlineResponse20015Data

type InlineResponse20015DataMetadata

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

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

type InlineResponse20016

type InlineResponse20016 struct {
	Data []InlineResponse20016Data `json:"data,omitempty"`
}

InlineResponse20016 struct for InlineResponse20016

type InlineResponse20016Data

type InlineResponse20016Data 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"`
}

InlineResponse20016Data struct for InlineResponse20016Data

type InlineResponse20017

type InlineResponse20017 struct {
	Data InlineResponse20016Data `json:"data,omitempty"`
}

InlineResponse20017 struct for InlineResponse20017

type InlineResponse20018

type InlineResponse20018 struct {
	Data InlineResponse20018Data `json:"data,omitempty"`
}

InlineResponse20018 struct for InlineResponse20018

type InlineResponse20018Data

type InlineResponse20018Data 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"`
}

InlineResponse20018Data struct for InlineResponse20018Data

type InlineResponse20019

type InlineResponse20019 struct {
	Data InlineResponse20019Data `json:"data,omitempty"`
}

InlineResponse20019 struct for InlineResponse20019

type InlineResponse20019Data

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

InlineResponse20019Data struct for InlineResponse20019Data

type InlineResponse2001Data

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

InlineResponse2001Data struct for InlineResponse2001Data

type InlineResponse2002

type InlineResponse2002 struct {
	Data InlineResponse2002Data `json:"data,omitempty"`
}

InlineResponse2002 struct for InlineResponse2002

type InlineResponse20020

type InlineResponse20020 struct {
	Data []InlineResponse2002Data `json:"data,omitempty"`
}

InlineResponse20020 struct for InlineResponse20020

type InlineResponse20021

type InlineResponse20021 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"`
}

InlineResponse20021 struct for InlineResponse20021

type InlineResponse20022

type InlineResponse20022 struct {
	Data InlineResponse20022Data `json:"data,omitempty"`
}

InlineResponse20022 struct for InlineResponse20022

type InlineResponse20022Data

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

InlineResponse20022Data struct for InlineResponse20022Data

type InlineResponse2002Data

type InlineResponse2002Data 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"`
}

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

type InlineResponse2003

type InlineResponse2003 struct {
	Data InlineResponse2003Data `json:"data,omitempty"`
}

InlineResponse2003 struct for InlineResponse2003

type InlineResponse2003Data

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

InlineResponse2003Data struct for InlineResponse2003Data

type InlineResponse2003DataPreviousJustified

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

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

type InlineResponse2004

type InlineResponse2004 struct {
	Data []InlineResponse2004Data `json:"data,omitempty"`
}

InlineResponse2004 struct for InlineResponse2004

type InlineResponse2004Data

type InlineResponse2004Data 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 InlineResponse2004Validator `json:"validator,omitempty"`
}

InlineResponse2004Data struct for InlineResponse2004Data

type InlineResponse2004Validator

type InlineResponse2004Validator 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"`
}

InlineResponse2004Validator struct for InlineResponse2004Validator

type InlineResponse2005

type InlineResponse2005 struct {
	Data InlineResponse2004Data `json:"data,omitempty"`
}

InlineResponse2005 struct for InlineResponse2005

type InlineResponse2006

type InlineResponse2006 struct {
	Data []InlineResponse2006Data `json:"data,omitempty"`
}

InlineResponse2006 struct for InlineResponse2006

type InlineResponse2006Data

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

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

type InlineResponse2007

type InlineResponse2007 struct {
	Data []InlineResponse2007Data `json:"data,omitempty"`
}

InlineResponse2007 struct for InlineResponse2007

type InlineResponse2007Data

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

InlineResponse2007Data struct for InlineResponse2007Data

type InlineResponse2007Header

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

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

type InlineResponse2008

type InlineResponse2008 struct {
	Data InlineResponse2008Data `json:"data,omitempty"`
}

InlineResponse2008 struct for InlineResponse2008

type InlineResponse2008Data

type InlineResponse2008Data struct {
	Canonical bool                     `json:"canonical,omitempty"`
	Header    InlineResponse2007Header `json:"header,omitempty"`
}

InlineResponse2008Data struct for InlineResponse2008Data

type InlineResponse2009

type InlineResponse2009 struct {
	Data InlineResponse2009Data `json:"data,omitempty"`
}

InlineResponse2009 struct for InlineResponse2009

type InlineResponse2009Data

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

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

type InlineResponse200Data

type InlineResponse200Data 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"`
}

InlineResponse200Data struct for InlineResponse200Data

type MinimalValidatorApiApiService

type MinimalValidatorApiApiService service

MinimalValidatorApiApiService MinimalValidatorApiApi service

func (*MinimalValidatorApiApiService) 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 InlineResponse200

func (*MinimalValidatorApiApiService) 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 InlineResponse2002

func (*MinimalValidatorApiApiService) GetStateValidator

func (a *MinimalValidatorApiApiService) GetStateValidator(ctx _context.Context, stateId string, validatorId string) (InlineResponse2005, *_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 InlineResponse2005

func (*MinimalValidatorApiApiService) 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 InlineResponse20019

func (*MinimalValidatorApiApiService) SubmitPoolAttestations

func (a *MinimalValidatorApiApiService) SubmitPoolAttestations(ctx _context.Context, inlineObject InlineObject) (*_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 inlineObject

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           InlineResponse20015DataMetadata `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

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

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 InlineResponse20015

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 InlineResponse20018

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 InlineResponse20017

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 InlineResponse20016

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 InlineResponse20019

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 ProposerSlashing

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

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

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 struct for SignedAggregateAndProof

type SignedBeaconBlock

type SignedBeaconBlock struct {
	// The [`BeaconBlock`](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/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.10.1/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.11.1/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.11.1/specs/phase0/beacon-chain.md#signedbeaconblockheader) object envelope from the Eth2.0 spec.

type SignedVoluntaryExit

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

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

type ValidatorRequiredApiApiService

type ValidatorRequiredApiApiService service

ValidatorRequiredApiApiService ValidatorRequiredApiApi service

func (*ValidatorRequiredApiApiService) 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 InlineResponse200

func (*ValidatorRequiredApiApiService) 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 InlineResponse2002

func (*ValidatorRequiredApiApiService) GetStateValidator

func (a *ValidatorRequiredApiApiService) GetStateValidator(ctx _context.Context, stateId string, validatorId string) (InlineResponse2005, *_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 InlineResponse2005

func (*ValidatorRequiredApiApiService) 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 InlineResponse20019

func (*ValidatorRequiredApiApiService) SubmitPoolAttestations

func (a *ValidatorRequiredApiApiService) SubmitPoolAttestations(ctx _context.Context, inlineObject InlineObject) (*_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 inlineObject

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 InlineResponse2004Validator `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