lighthousehttp

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithAddress

func WithAddress(address string) Parameter

WithAddress provides the address for the endpoint.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithTimeout

func WithTimeout(timeout time.Duration) Parameter

WithTimeout sets the maximum duration for all requests to the endpoint.

type Service

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

Service is an Ethereum 2 client service.

func New

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

New creates a new Ethereum 2 client service, connecting with Lighthouse HTTP.

func (*Service) AddOnBeaconChainHeadUpdatedHandler

func (s *Service) AddOnBeaconChainHeadUpdatedHandler(ctx context.Context, handler client.BeaconChainHeadUpdatedHandler) error

AddOnBeaconChainHeadUpdatedHandler adds a handler provided with beacon chain head updates.

func (*Service) Address added in v0.6.8

func (s *Service) Address() string

Address provides the address for the connection.

func (*Service) AggregateAndProofDomain

func (s *Service) AggregateAndProofDomain(ctx context.Context) ([]byte, error)

AggregateAndProofDomain provides the aggregate and proof domain of the chain.

func (*Service) AttestationData

func (s *Service) AttestationData(ctx context.Context, slot uint64, committeeIndex uint64) (*spec.AttestationData, error)

AttestationData obtains attestation data for a slot.

func (*Service) AttesterDuties

func (s *Service) AttesterDuties(ctx context.Context, epoch uint64, validators []client.ValidatorIDProvider) ([]*api.AttesterDuty, error)

AttesterDuties obtains attester duties.

func (*Service) BeaconAttesterDomain

func (s *Service) BeaconAttesterDomain(ctx context.Context) ([]byte, error)

BeaconAttesterDomain provides the beacon attester domain of the chain.

func (*Service) BeaconBlockProposal

func (s *Service) BeaconBlockProposal(ctx context.Context, slot uint64, randaoReveal []byte, graffiti []byte) (*spec.BeaconBlock, error)

BeaconBlockProposal fetches a proposed beacon block for signing.

func (*Service) BeaconBlockRootBySlot

func (s *Service) BeaconBlockRootBySlot(ctx context.Context, slot uint64) ([]byte, error)

BeaconBlockRootBySlot fetches a block's root given its slot.

func (*Service) BeaconCommittees

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

BeaconCommittees fetches the chain's beacon committees given a state.

func (*Service) BeaconProposerDomain

func (s *Service) BeaconProposerDomain(ctx context.Context) ([]byte, error)

BeaconProposerDomain provides the beacon proposer domain of the chain.

func (*Service) CurrentEpoch

func (s *Service) CurrentEpoch(ctx context.Context) (uint64, error)

CurrentEpoch is a helper that calculates the current epoch.

func (*Service) CurrentSlot

func (s *Service) CurrentSlot(ctx context.Context) (uint64, error)

CurrentSlot is a helper that calculates the current slot.

func (*Service) DepositDomain

func (s *Service) DepositDomain(ctx context.Context) ([]byte, error)

DepositDomain provides the deposit domain of the chain.

func (*Service) EpochFromStateID added in v0.6.3

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

EpochFromStateID parses the state ID and returns the relevant epoch.

func (*Service) FarFutureEpoch

func (s *Service) FarFutureEpoch(ctx context.Context) (uint64, error)

FarFutureEpoch provides the value of the far future epoch of the chain.

func (*Service) Fork

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

Fork provides the fork of the chain at a given epoch.

func (*Service) Genesis

func (s *Service) Genesis(ctx context.Context) (*api.Genesis, error)

Genesis provides the genesis information of the chain.

func (*Service) GenesisTime

func (s *Service) GenesisTime(ctx context.Context) (time.Time, error)

GenesisTime provides the genesis time of the chain.

func (*Service) GenesisValidatorsRoot

func (s *Service) GenesisValidatorsRoot(ctx context.Context) ([]byte, error)

GenesisValidatorsRoot provides the genesis validators root of the chain.

func (*Service) Name

func (s *Service) Name() string

Name provides the name of the service.

func (*Service) NodeVersion

func (s *Service) NodeVersion(ctx context.Context) (string, error)

NodeVersion returns a free-text string with the node version.

func (*Service) NonSpecAggregateAttestation

func (s *Service) NonSpecAggregateAttestation(ctx context.Context, attestation *spec.Attestation, validatorPubKey []byte, slotSignature []byte) (*spec.Attestation, error)

NonSpecAggregateAttestation fetches the aggregate attestation given an attestation.

func (*Service) ProposerDuties

func (s *Service) ProposerDuties(ctx context.Context, epoch uint64, validators []client.ValidatorIDProvider) ([]*api.ProposerDuty, error)

ProposerDuties obtains proposer duties.

func (*Service) RANDAODomain

func (s *Service) RANDAODomain(ctx context.Context) ([]byte, error)

RANDAODomain provides the RANDAO domain of the chain.

func (*Service) SelectionProofDomain

func (s *Service) SelectionProofDomain(ctx context.Context) ([]byte, error)

SelectionProofDomain provides the selection proof domain of the chain.

func (*Service) SignatureDomain

func (s *Service) SignatureDomain(ctx context.Context, domain []byte, epoch uint64) ([]byte, error)

SignatureDomain provides a signature domain for a given domain at a given epoch.

func (*Service) SignedBeaconBlockBySlot

func (s *Service) SignedBeaconBlockBySlot(ctx context.Context, slot uint64) (*spec.SignedBeaconBlock, error)

SignedBeaconBlockBySlot fetches a signed beacon block given its slot.

func (*Service) SlotDuration

func (s *Service) SlotDuration(ctx context.Context) (time.Duration, error)

SlotDuration provides the duration of a slot of the chain.

func (*Service) SlotFromStateID added in v0.6.3

func (s *Service) SlotFromStateID(ctx context.Context, stateID string) (uint64, error)

SlotFromStateID parses the state ID and returns the relevant slot.

func (*Service) SlotsPerEpoch

func (s *Service) SlotsPerEpoch(ctx context.Context) (uint64, error)

SlotsPerEpoch provides the slots per epoch of the chain.

func (*Service) StateRootFromStateID added in v0.6.3

func (s *Service) StateRootFromStateID(ctx context.Context, stateID string) ([]byte, error)

StateRootFromStateID parses the state ID and returns the relevant state root.

func (*Service) SubmitAggregateAttestations

func (s *Service) SubmitAggregateAttestations(ctx context.Context, aggregateAndProofs []*spec.SignedAggregateAndProof) error

SubmitAggregateAttestations submits aggregate attestations.

func (*Service) SubmitAttestation

func (s *Service) SubmitAttestation(ctx context.Context, specAttestation *spec.Attestation) error

SubmitAttestation submits an attestation.

func (*Service) SubmitBeaconBlock

func (s *Service) SubmitBeaconBlock(ctx context.Context, specBlock *spec.SignedBeaconBlock) error

SubmitBeaconBlock submits a beacon block.

func (*Service) SubmitBeaconCommitteeSubscriptions

func (s *Service) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*client.BeaconCommitteeSubscription) error

SubmitBeaconCommitteeSubscriptions subscribes to beacon committees.

func (*Service) SyncState

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

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

func (*Service) TargetAggregatorsPerCommittee

func (s *Service) TargetAggregatorsPerCommittee(ctx context.Context) (uint64, error)

TargetAggregatorsPerCommittee provides the target number of aggregators for each attestation committee.

func (*Service) ValidatorBalances

func (s *Service) ValidatorBalances(ctx context.Context, stateID string, validatorIDs []client.ValidatorIDProvider) (map[uint64]uint64, 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". validators is a list of validators 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, validatorIDs []client.ValidatorIDProvider) (map[uint64]*api.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". validators is a list of validators to restrict the returned values. If no validators are supplied no filter will be applied.

func (*Service) VoluntaryExitDomain

func (s *Service) VoluntaryExitDomain(ctx context.Context) ([]byte, error)

VoluntaryExitDomain provides the voluntary exit domain of the chain.

Jump to

Keyboard shortcuts

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