beacon

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	BeaconDB            db.Database
	Ctx                 context.Context
	ChainStartFetcher   powchain.ChainStartFetcher
	HeadFetcher         blockchain.HeadFetcher
	FinalizationFetcher blockchain.FinalizationFetcher
	StateFeedListener   blockchain.ChainFeeds
	Pool                operations.Pool
	IncomingAttestation chan *ethpb.Attestation
	CanonicalStateChan  chan *pbp2p.BeaconState
	ChainStartChan      chan time.Time
}

Server defines a server implementation of the gRPC Beacon Chain service, providing RPC endpoints to access data relevant to the Ethereum 2.0 phase 0 beacon chain.

func (*Server) AttestationPool

func (bs *Server) AttestationPool(
	ctx context.Context, _ *ptypes.Empty,
) (*ethpb.AttestationPoolResponse, error)

AttestationPool retrieves pending attestations.

The server returns a list of attestations that have been seen but not yet processed. Pool attestations eventually expire as the slot advances, so an attestation missing from this request does not imply that it was included in a block. The attestation may have expired. Refer to the ethereum 2.0 specification for more details on how attestations are processed and when they are no longer valid. https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations

func (*Server) GetChainHead

func (bs *Server) GetChainHead(ctx context.Context, _ *ptypes.Empty) (*ethpb.ChainHead, error)

GetChainHead retrieves information about the head of the beacon chain from the view of the beacon chain node.

This includes the head block slot and root as well as information about the most recent finalized and justified slots.

func (*Server) GetValidatorActiveSetChanges

func (bs *Server) GetValidatorActiveSetChanges(
	ctx context.Context, req *ethpb.GetValidatorActiveSetChangesRequest,
) (*ethpb.ActiveSetChanges, error)

GetValidatorActiveSetChanges retrieves the active set changes for a given epoch.

This data includes any activations, voluntary exits, and involuntary ejections.

func (*Server) GetValidatorParticipation

GetValidatorParticipation retrieves the validator participation information for a given epoch, it returns the information about validator's participation rate in voting on the proof of stake rules based on their balance compared to the total active validator balance.

func (*Server) GetValidatorQueue

func (bs *Server) GetValidatorQueue(
	ctx context.Context, _ *ptypes.Empty,
) (*ethpb.ValidatorQueue, error)

GetValidatorQueue retrieves the current validator queue information.

func (*Server) GetValidators

func (bs *Server) GetValidators(
	ctx context.Context,
	req *ethpb.GetValidatorsRequest,
) (*ethpb.Validators, error)

GetValidators retrieves the current list of active validators with an optional historical epoch flag to to retrieve validator set in time.

func (*Server) ListAttestations

func (bs *Server) ListAttestations(
	ctx context.Context, req *ethpb.ListAttestationsRequest,
) (*ethpb.ListAttestationsResponse, error)

ListAttestations retrieves attestations by block root, slot, or epoch. Attestations are sorted by data slot by default.

The server may return an empty list when no attestations match the given filter criteria. This RPC should not return NOT_FOUND. Only one filter criteria should be used.

func (*Server) ListBeaconCommittees

func (bs *Server) ListBeaconCommittees(
	ctx context.Context,
	req *ethpb.ListCommitteesRequest,
) (*ethpb.BeaconCommittees, error)

ListBeaconCommittees for a given epoch.

If no filter criteria is specified, the response returns all beacon committees for the current epoch. The results are paginated by default.

func (*Server) ListBlocks

func (bs *Server) ListBlocks(
	ctx context.Context, req *ethpb.ListBlocksRequest,
) (*ethpb.ListBlocksResponse, error)

ListBlocks retrieves blocks by root, slot, or epoch.

The server may return multiple blocks in the case that a slot or epoch is provided as the filter criteria. The server may return an empty list when no blocks in their database match the filter criteria. This RPC should not return NOT_FOUND. Only one filter criteria should be used.

func (*Server) ListValidatorAssignments

func (bs *Server) ListValidatorAssignments(
	ctx context.Context, req *ethpb.ListValidatorAssignmentsRequest,
) (*ethpb.ValidatorAssignments, error)

ListValidatorAssignments retrieves the validator assignments for a given epoch, optional validator indices or public keys may be included to filter validator assignments.

func (*Server) ListValidatorBalances

func (bs *Server) ListValidatorBalances(
	ctx context.Context,
	req *ethpb.GetValidatorBalancesRequest) (*ethpb.ValidatorBalances, error)

ListValidatorBalances retrieves the validator balances for a given set of public keys. An optional Epoch parameter is provided to request historical validator balances from archived, persistent data.

Jump to

Keyboard shortcuts

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