Documentation ¶
Overview ¶
Package eth2wrap provides a wrapper for eth2http.Service adding prometheus metrics and error wrapping.
Index ¶
- type Service
- func (s *Service) AggregateAttestation(ctx context.Context, slot phase0.Slot, attestationDataRoot phase0.Root) (*phase0.Attestation, error)
- func (s *Service) AttestationData(ctx context.Context, slot phase0.Slot, committeeIndex phase0.CommitteeIndex) (*phase0.AttestationData, error)
- func (s *Service) AttestationPool(ctx context.Context, slot phase0.Slot) ([]*phase0.Attestation, error)
- func (s *Service) AttesterDuties(ctx context.Context, epoch phase0.Epoch, ...) ([]*apiv1.AttesterDuty, error)
- func (s *Service) BeaconBlockHeader(ctx context.Context, blockID string) (*apiv1.BeaconBlockHeader, error)
- func (s *Service) BeaconBlockProposal(ctx context.Context, slot phase0.Slot, randaoReveal phase0.BLSSignature, ...) (*spec.VersionedBeaconBlock, error)
- func (s *Service) BeaconBlockRoot(ctx context.Context, blockID string) (*phase0.Root, error)
- func (s *Service) BeaconCommittees(ctx context.Context, stateID string) ([]*apiv1.BeaconCommittee, error)
- func (s *Service) BeaconCommitteesAtEpoch(ctx context.Context, stateID string, epoch phase0.Epoch) ([]*apiv1.BeaconCommittee, error)
- func (s *Service) BeaconState(ctx context.Context, stateID string) (*spec.VersionedBeaconState, error)
- func (s *Service) BeaconStateRoot(ctx context.Context, stateID string) (*phase0.Root, error)
- func (s *Service) BlindedBeaconBlockProposal(ctx context.Context, slot phase0.Slot, randaoReveal phase0.BLSSignature, ...) (*api.VersionedBlindedBeaconBlock, error)
- func (s *Service) EpochFromStateID(ctx context.Context, stateID string) (phase0.Epoch, error)
- func (s *Service) Events(ctx context.Context, topics []string, handler eth2client.EventHandlerFunc) error
- func (s *Service) Finality(ctx context.Context, stateID string) (*apiv1.Finality, error)
- func (s *Service) Fork(ctx context.Context, stateID string) (*phase0.Fork, error)
- func (s *Service) NodeSyncing(ctx context.Context) (*apiv1.SyncState, error)
- func (s *Service) ProposerDuties(ctx context.Context, epoch phase0.Epoch, ...) ([]*apiv1.ProposerDuty, error)
- func (s *Service) SignedBeaconBlock(ctx context.Context, blockID string) (*spec.VersionedSignedBeaconBlock, error)
- func (s *Service) SyncCommittee(ctx context.Context, stateID string) (*apiv1.SyncCommittee, error)
- func (s *Service) SyncCommitteeAtEpoch(ctx context.Context, stateID string, epoch phase0.Epoch) (*apiv1.SyncCommittee, error)
- func (s *Service) SyncCommitteeContribution(ctx context.Context, slot phase0.Slot, subcommitteeIndex uint64, ...) (*altair.SyncCommitteeContribution, error)
- func (s *Service) SyncCommitteeDuties(ctx context.Context, epoch phase0.Epoch, ...) ([]*apiv1.SyncCommitteeDuty, error)
- func (s *Service) ValidatorBalances(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]phase0.Gwei, error)
- func (s *Service) Validators(ctx context.Context, stateID string, validatorIndices []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]*apiv1.Validator, error)
- func (s *Service) ValidatorsByPubKey(ctx context.Context, stateID string, validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*apiv1.Validator, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
Service wraps an eth2http.Service adding prometheus metrics and error wrapping.
func NewHTTPService ¶
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 ¶
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 ¶
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 ¶
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) NodeSyncing ¶
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 ¶
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.