eth2wrap

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package eth2wrap provides a wrapper for eth2http.Service adding prometheus metrics and error wrapping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	*eth2http.Service
}

Service wraps an eth2http.Service adding prometheus metrics and error wrapping.

func NewHTTPService

func NewHTTPService(ctx context.Context, params ...eth2http.Parameter) (*Service, error)

NewHTTPService returns a new instrumented eth2 http service.

func (*Service) AggregateAttestation

func (s *Service) AggregateAttestation(ctx context.Context, slot phase0.Slot, attestationDataRoot phase0.Root) (*phase0.Attestation, error)

AggregateAttestation fetches the aggregate attestation given an attestation.

func (*Service) AttestationData

func (s *Service) AttestationData(ctx context.Context, slot phase0.Slot, committeeIndex phase0.CommitteeIndex) (*phase0.AttestationData, error)

AttestationData fetches the attestation data for the given slot and committee index.

func (*Service) AttestationPool

func (s *Service) AttestationPool(ctx context.Context, slot phase0.Slot) ([]*phase0.Attestation, error)

AttestationPool fetches the attestation pool for the given slot.

func (*Service) AttesterDuties

func (s *Service) AttesterDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*apiv1.AttesterDuty, error)

AttesterDuties obtains attester duties. If validatorIndicess is nil it will return all duties for the given epoch.

func (*Service) BeaconBlockHeader

func (s *Service) BeaconBlockHeader(ctx context.Context, blockID string) (*apiv1.BeaconBlockHeader, error)

BeaconBlockHeader provides the block header of a given block ID.

func (*Service) BeaconBlockProposal

func (s *Service) BeaconBlockProposal(ctx context.Context, slot phase0.Slot, randaoReveal phase0.BLSSignature, graffiti []byte) (*spec.VersionedBeaconBlock, error)

BeaconBlockProposal fetches a proposed beacon block for signing.

func (*Service) BeaconBlockRoot

func (s *Service) BeaconBlockRoot(ctx context.Context, blockID string) (*phase0.Root, error)

BeaconBlockRoot fetches a block's root given a block ID.

func (*Service) BeaconCommittees

func (s *Service) BeaconCommittees(ctx context.Context, stateID string) ([]*apiv1.BeaconCommittee, error)

BeaconCommittees fetches all beacon committees for the epoch at the given state.

func (*Service) BeaconCommitteesAtEpoch

func (s *Service) BeaconCommitteesAtEpoch(ctx context.Context, stateID string, epoch phase0.Epoch) ([]*apiv1.BeaconCommittee, error)

BeaconCommitteesAtEpoch fetches all beacon committees for the given epoch at the given state.

func (*Service) BeaconState

func (s *Service) BeaconState(ctx context.Context, stateID string) (*spec.VersionedBeaconState, error)

BeaconState fetches a beacon state given a state ID.

func (*Service) BeaconStateRoot

func (s *Service) BeaconStateRoot(ctx context.Context, stateID string) (*phase0.Root, error)

BeaconStateRoot fetches a beacon state root given a state ID.

func (*Service) BlindedBeaconBlockProposal

func (s *Service) BlindedBeaconBlockProposal(ctx context.Context, slot phase0.Slot, randaoReveal phase0.BLSSignature, graffiti []byte) (*api.VersionedBlindedBeaconBlock, error)

BlindedBeaconBlockProposal fetches a blinded proposed beacon block for signing.

func (*Service) EpochFromStateID

func (s *Service) EpochFromStateID(ctx context.Context, stateID string) (phase0.Epoch, error)

EpochFromStateID converts a state ID to its epoch.

func (*Service) Events

func (s *Service) Events(ctx context.Context, topics []string, handler eth2client.EventHandlerFunc) error

Events feeds requested events with the given topics to the supplied handler.

func (*Service) Finality

func (s *Service) Finality(ctx context.Context, stateID string) (*apiv1.Finality, error)

Finality provides the finality given a state ID.

func (*Service) Fork

func (s *Service) Fork(ctx context.Context, stateID string) (*phase0.Fork, error)

Fork fetches fork information for the given state.

func (*Service) NodeSyncing

func (s *Service) NodeSyncing(ctx context.Context) (*apiv1.SyncState, error)

NodeSyncing provides the state of the node's synchronization with the chain.

func (*Service) ProposerDuties

func (s *Service) ProposerDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*apiv1.ProposerDuty, error)

ProposerDuties obtains proposer duties for the given epoch. If validatorIndices is empty all duties are returned, otherwise only matching duties are returned.

func (*Service) SignedBeaconBlock

func (s *Service) SignedBeaconBlock(ctx context.Context, blockID string) (*spec.VersionedSignedBeaconBlock, error)

SignedBeaconBlock fetches a signed beacon block given a block ID.

func (*Service) SyncCommittee

func (s *Service) SyncCommittee(ctx context.Context, stateID string) (*apiv1.SyncCommittee, error)

SyncCommittee fetches the sync committee for the given state.

func (*Service) SyncCommitteeAtEpoch

func (s *Service) SyncCommitteeAtEpoch(ctx context.Context, stateID string, epoch phase0.Epoch) (*apiv1.SyncCommittee, error)

SyncCommitteeAtEpoch fetches the sync committee for the given epoch at the given state.

func (*Service) SyncCommitteeContribution

func (s *Service) SyncCommitteeContribution(ctx context.Context, slot phase0.Slot, subcommitteeIndex uint64, beaconBlockRoot phase0.Root) (*altair.SyncCommitteeContribution, error)

SyncCommitteeContribution provides a sync committee contribution.

func (*Service) SyncCommitteeDuties

func (s *Service) SyncCommitteeDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*apiv1.SyncCommitteeDuty, error)

SyncCommitteeDuties obtains sync committee duties. If validatorIndicess is nil it will return all duties for the given epoch.

func (*Service) ValidatorBalances

func (s *Service) ValidatorBalances(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]phase0.Gwei, error)

ValidatorBalances provides the validator balances for a given state. stateID can be a slot number or state root, or one of the special values "genesis", "head", "justified" or "finalized". validatorIndices is a list of validator indices to restrict the returned values. If no validators are supplied no filter will be applied.

func (*Service) Validators

func (s *Service) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]*apiv1.Validator, error)

Validators provides the validators, with their balance and status, for a given state. stateID can be a slot number or state root, or one of the special values "genesis", "head", "justified" or "finalized". validatorIndices is a list of validator indices to restrict the returned values. If no validators IDs are supplied no filter will be applied.

func (*Service) ValidatorsByPubKey

func (s *Service) ValidatorsByPubKey(ctx context.Context, stateID string, validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*apiv1.Validator, error)

ValidatorsByPubKey provides the validators, with their balance and status, for a given state. stateID can be a slot number or state root, or one of the special values "genesis", "head", "justified" or "finalized". validatorPubKeys is a list of validator public keys to restrict the returned values. If no validators public keys are supplied no filter will be applied.

Directories

Path Synopsis
Command genwrap provides a code generator for eth2client provider methods implemented by eth2http.Service.
Command genwrap provides a code generator for eth2client provider methods implemented by eth2http.Service.

Jump to

Keyboard shortcuts

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