v1

package
v0.6.30 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.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 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 a standard HTTP.

func (*Service) Address added in v0.6.9

func (s *Service) Address() string

Address provides the address for the connection.

func (*Service) AggregateAndProofDomain

func (s *Service) AggregateAndProofDomain(ctx context.Context) (spec.DomainType, error)

AggregateAndProofDomain provides the aggregate and proof domain of the chain.

func (*Service) AggregateAttestation added in v0.6.9

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

AggregateAttestation fetches the aggregate attestation given an attestation. N.B if an aggregate attestation for the attestation is not available this will return nil without an error.

func (*Service) AttestationData added in v0.6.9

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

AttestationData obtains attestation data for a slot.

func (*Service) AttestationPool added in v0.6.23

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

AttestationPool obtains the attestation pool for a given slot.

func (*Service) AttesterDuties added in v0.6.9

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

AttesterDuties obtains attester duties.

func (*Service) BeaconAttesterDomain

func (s *Service) BeaconAttesterDomain(ctx context.Context) (spec.DomainType, error)

BeaconAttesterDomain provides the beacon attester domain of the chain.

func (*Service) BeaconBlockHeader added in v0.6.9

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

BeaconBlockHeader provides the block header of a given block ID.

func (*Service) BeaconBlockProposal added in v0.6.9

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

BeaconBlockProposal fetches a proposed beacon block for signing.

func (*Service) BeaconCommittees added in v0.6.9

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

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

func (*Service) BeaconProposerDomain

func (s *Service) BeaconProposerDomain(ctx context.Context) (spec.DomainType, error)

BeaconProposerDomain provides the beacon proposer domain of the chain.

func (*Service) BeaconState added in v0.6.9

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

BeaconState fetches a beacon state. N.B if the requested beacon state is not available this will return nil without an error.

func (*Service) DepositContract

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

DepositContract provides details of the Ethereum 1 deposit contract for the chain.

func (*Service) DepositDomain

func (s *Service) DepositDomain(ctx context.Context) (spec.DomainType, error)

DepositDomain provides the deposit domain of the chain.

func (*Service) Domain added in v0.6.9

func (s *Service) Domain(ctx context.Context, domainType spec.DomainType, epoch spec.Epoch) (spec.Domain, error)

Domain provides a domain for a given domain type at a given epoch.

func (*Service) EpochFromStateID added in v0.6.9

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

EpochFromStateID parses the state ID and returns the relevant epoch.

func (*Service) Events added in v0.6.9

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

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

func (*Service) FarFutureEpoch

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

FarFutureEpoch provides the values for FAR_FUTURE_EOPCH of the chain.

func (*Service) Finality added in v0.6.9

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

Finality provides the finality given a state ID.

func (*Service) Fork added in v0.6.9

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

Fork fetches fork information for the given state.

func (*Service) ForkSchedule

func (s *Service) ForkSchedule(ctx context.Context) ([]*spec.Fork, error)

ForkSchedule provides details of past and future changes in the chain's fork version.

func (*Service) Genesis

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

Genesis provides the genesis information of the chain.

func (*Service) GenesisTime added in v0.6.9

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

GenesisTime provides the genesis time of the chain.

func (*Service) Name

func (s *Service) Name() string

Name provides the name of the service.

func (*Service) NodeSyncing added in v0.6.9

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

NodeSyncing provides the syncing information for the node.

func (*Service) NodeVersion

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

NodeVersion provides the version information of the node.

func (*Service) ProposerDuties added in v0.6.9

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

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

func (*Service) RANDAODomain

func (s *Service) RANDAODomain(ctx context.Context) (spec.DomainType, error)

RANDAODomain provides the RANDAO domain of the chain.

func (*Service) SelectionProofDomain

func (s *Service) SelectionProofDomain(ctx context.Context) (spec.DomainType, error)

SelectionProofDomain provides the selection proof domain of the chain.

func (*Service) SignedBeaconBlock added in v0.6.9

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

SignedBeaconBlock fetches a signed beacon block given a block ID. N.B if a signed beacon block for the block ID is not available this will return nil without an error.

func (*Service) SlotDuration

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

SlotDuration provides the duration of a slot for the chain.

func (*Service) SlotFromStateID added in v0.6.9

func (s *Service) SlotFromStateID(ctx context.Context, stateID string) (spec.Slot, 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 number of slots per epoch for the chain.

func (*Service) Spec

func (s *Service) Spec(ctx context.Context) (map[string]interface{}, error)

Spec provides the spec information of the chain.

func (*Service) StateRoot

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

StateRoot provides the state root given a state ID.

func (*Service) SubmitAggregateAttestations added in v0.6.9

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

SubmitAggregateAttestations submits aggregate attestations.

func (*Service) SubmitAttestations added in v0.6.9

func (s *Service) SubmitAttestations(ctx context.Context, attestations []*spec.Attestation) error

SubmitAttestations submits attestations.

func (*Service) SubmitBeaconBlock added in v0.6.9

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

SubmitBeaconBlock submits a beacon block.

func (*Service) SubmitBeaconCommitteeSubscriptions added in v0.6.9

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

SubmitBeaconCommitteeSubscriptions subscribes to beacon committees.

func (*Service) SubmitVoluntaryExit added in v0.6.10

func (s *Service) SubmitVoluntaryExit(ctx context.Context, voluntaryExit *spec.SignedVoluntaryExit) error

SubmitVoluntaryExit submits a voluntary exit.

func (*Service) TargetAggregatorsPerCommittee added in v0.6.9

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

TargetAggregatorsPerCommittee provides the target aggregators per committee of the chain.

func (*Service) ValidatorBalances added in v0.6.9

func (s *Service) ValidatorBalances(ctx context.Context, stateID string, validatorIndices []spec.ValidatorIndex) (map[spec.ValidatorIndex]spec.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 added in v0.6.9

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

func (*Service) ValidatorsByPubKey added in v0.6.9

func (s *Service) ValidatorsByPubKey(ctx context.Context, stateID string, validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*api.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.

func (*Service) VoluntaryExitDomain

func (s *Service) VoluntaryExitDomain(ctx context.Context) (spec.DomainType, 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