Documentation ¶
Index ¶
- func New(ctx context.Context, params ...Parameter) (consensusclient.Service, error)
- type Parameter
- type Service
- func (s *Service) Address() string
- 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, ...) ([]*api.AttesterDuty, error)
- func (s *Service) BeaconBlockHeader(ctx context.Context, blockID string) (*api.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) ([]*api.BeaconCommittee, error)
- func (s *Service) BeaconCommitteesAtEpoch(ctx context.Context, stateID string, epoch phase0.Epoch) ([]*api.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) DepositContract(ctx context.Context) (*api.DepositContract, error)
- func (s *Service) Domain(ctx context.Context, domainType phase0.DomainType, epoch phase0.Epoch) (phase0.Domain, error)
- func (s *Service) Events(ctx context.Context, topics []string, handler consensusclient.EventHandlerFunc) error
- func (s *Service) FarFutureEpoch(ctx context.Context) (phase0.Epoch, error)
- func (s *Service) Finality(ctx context.Context, stateID string) (*api.Finality, error)
- func (s *Service) Fork(ctx context.Context, stateID string) (*phase0.Fork, error)
- func (s *Service) ForkSchedule(ctx context.Context) ([]*phase0.Fork, error)
- func (s *Service) Genesis(ctx context.Context) (*api.Genesis, error)
- func (s *Service) GenesisDomain(ctx context.Context, domainType phase0.DomainType) (phase0.Domain, error)
- func (s *Service) GenesisTime(ctx context.Context) (time.Time, error)
- func (s *Service) Name() string
- func (s *Service) NodeSyncing(ctx context.Context) (*api.SyncState, error)
- func (s *Service) NodeVersion(ctx context.Context) (string, error)
- func (s *Service) ProposerDuties(ctx context.Context, epoch phase0.Epoch, ...) ([]*api.ProposerDuty, error)
- func (s *Service) SignedBeaconBlock(ctx context.Context, blockID string) (*spec.VersionedSignedBeaconBlock, error)
- func (s *Service) SlotDuration(ctx context.Context) (time.Duration, error)
- func (s *Service) SlotsPerEpoch(ctx context.Context) (uint64, error)
- func (s *Service) Spec(ctx context.Context) (map[string]interface{}, error)
- func (s *Service) SubmitAggregateAttestations(ctx context.Context, aggregateAndProofs []*phase0.SignedAggregateAndProof) error
- func (s *Service) SubmitAttestations(ctx context.Context, attestations []*phase0.Attestation) error
- func (s *Service) SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSignedBeaconBlock) error
- func (s *Service) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*api.BeaconCommitteeSubscription) error
- func (s *Service) SubmitBlindedBeaconBlock(ctx context.Context, block *api.VersionedSignedBlindedBeaconBlock) error
- func (s *Service) SubmitProposalPreparations(ctx context.Context, preparations []*apiv1.ProposalPreparation) error
- func (s *Service) SubmitSyncCommitteeContributions(ctx context.Context, ...) error
- func (s *Service) SubmitSyncCommitteeMessages(ctx context.Context, messages []*altair.SyncCommitteeMessage) error
- func (s *Service) SubmitSyncCommitteeSubscriptions(ctx context.Context, subscriptions []*api.SyncCommitteeSubscription) error
- func (s *Service) SubmitValidatorRegistrations(ctx context.Context, registrations []*api.VersionedSignedValidatorRegistration) error
- func (s *Service) SubmitVoluntaryExit(ctx context.Context, voluntaryExit *phase0.SignedVoluntaryExit) error
- func (s *Service) SyncCommittee(ctx context.Context, stateID string) (*api.SyncCommittee, error)
- func (s *Service) SyncCommitteeAtEpoch(ctx context.Context, stateID string, epoch phase0.Epoch) (*api.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, ...) ([]*api.SyncCommitteeDuty, error)
- func (s *Service) TargetAggregatorsPerCommittee(ctx context.Context) (uint64, 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]*api.Validator, error)
- func (s *Service) ValidatorsByPubKey(ctx context.Context, stateID string, validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*api.Validator, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithAddresses ¶
WithAddresses sets the addresses of clients to add to the multi list.
func WithClients ¶
func WithClients(clients []consensusclient.Service) Parameter
WithClients sets the pre-existing clients to add to the multi list.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithMonitor ¶
WithMonitor sets the monitor for the service.
func WithTimeout ¶
WithTimeout sets the timeout for client requests.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles multiple Ethereum 2 clients.
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 obtains the attestation pool for a given slot.
func (*Service) AttesterDuties ¶
func (s *Service) AttesterDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex, ) ( []*api.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) (*api.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) ([]*api.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) ([]*api.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. N.B if the requested beacon state is not available this will return nil without an error.
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 proposed blinded beacon block for signing.
func (*Service) DepositContract ¶
DepositContract provides details of the Ethereum 1 deposit contract for the chain.
func (*Service) Domain ¶
func (s *Service) Domain(ctx context.Context, domainType phase0.DomainType, epoch phase0.Epoch, ) ( phase0.Domain, error, )
Domain provides a domain for a given domain type at a given epoch.
func (*Service) Events ¶
func (s *Service) Events(ctx context.Context, topics []string, handler consensusclient.EventHandlerFunc, ) error
Events feeds requested events with the given topics to the supplied handler.
func (*Service) FarFutureEpoch ¶
FarFutureEpoch provides the far future epoch of the chain.
func (*Service) ForkSchedule ¶
ForkSchedule provides details of past and future changes in the chain's fork version.
func (*Service) GenesisDomain ¶
func (s *Service) GenesisDomain(ctx context.Context, domainType phase0.DomainType, ) ( phase0.Domain, error, )
GenesisDomain provides a domain for a given domain type.
func (*Service) GenesisTime ¶
GenesisTime provides the genesis time of the chain.
func (*Service) NodeSyncing ¶
NodeSyncing provides the syncing information for the node.
func (*Service) NodeVersion ¶
NodeVersion provides the version information of the node.
func (*Service) ProposerDuties ¶
func (s *Service) ProposerDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex, ) ( []*api.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. N.B if a signed beacon block for the block ID is not available this will return nil without an error.
func (*Service) SlotDuration ¶
SlotDuration provides the duration of a slot of the chain.
func (*Service) SlotsPerEpoch ¶
SlotsPerEpoch provides the slots per epoch of the chain.
func (*Service) SubmitAggregateAttestations ¶
func (s *Service) SubmitAggregateAttestations(ctx context.Context, aggregateAndProofs []*phase0.SignedAggregateAndProof, ) error
SubmitAggregateAttestations submits aggregate attestations.
func (*Service) SubmitAttestations ¶
func (s *Service) SubmitAttestations(ctx context.Context, attestations []*phase0.Attestation, ) error
SubmitAttestations submits attestations.
func (*Service) SubmitBeaconBlock ¶
func (s *Service) SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSignedBeaconBlock) error
SubmitBeaconBlock submits a beacon block.
func (*Service) SubmitBeaconCommitteeSubscriptions ¶
func (s *Service) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*api.BeaconCommitteeSubscription, ) error
SubmitBeaconCommitteeSubscriptions subscribes to beacon committees.
func (*Service) SubmitBlindedBeaconBlock ¶
func (s *Service) SubmitBlindedBeaconBlock(ctx context.Context, block *api.VersionedSignedBlindedBeaconBlock) error
SubmitBlindedBeaconBlock submits a blinded beacon block.
func (*Service) SubmitProposalPreparations ¶
func (s *Service) SubmitProposalPreparations(ctx context.Context, preparations []*apiv1.ProposalPreparation, ) error
SubmitProposalPreparations provides the beacon node with information required if a proposal for the given validators shows up in the next epoch.
func (*Service) SubmitSyncCommitteeContributions ¶
func (s *Service) SubmitSyncCommitteeContributions(ctx context.Context, contributionAndProofs []*altair.SignedContributionAndProof, ) error
SubmitSyncCommitteeContributions submits sync committee contributions.
func (*Service) SubmitSyncCommitteeMessages ¶
func (s *Service) SubmitSyncCommitteeMessages(ctx context.Context, messages []*altair.SyncCommitteeMessage, ) error
SubmitSyncCommitteeMessages submits sync committee messages.
func (*Service) SubmitSyncCommitteeSubscriptions ¶
func (s *Service) SubmitSyncCommitteeSubscriptions(ctx context.Context, subscriptions []*api.SyncCommitteeSubscription, ) error
SubmitSyncCommitteeSubscriptions subscribes to sync committees.
func (*Service) SubmitValidatorRegistrations ¶
func (s *Service) SubmitValidatorRegistrations(ctx context.Context, registrations []*api.VersionedSignedValidatorRegistration) error
SubmitValidatorRegistrations submits a validator registration.
func (*Service) SubmitVoluntaryExit ¶
func (s *Service) SubmitVoluntaryExit(ctx context.Context, voluntaryExit *phase0.SignedVoluntaryExit) error
SubmitVoluntaryExit submits a voluntary exit.
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) (*api.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, ) ( []*api.SyncCommitteeDuty, error, )
SyncCommitteeDuties obtains attester duties. If validatorIndicess is nil it will return all duties for the given epoch.
func (*Service) TargetAggregatorsPerCommittee ¶
TargetAggregatorsPerCommittee provides the target number of aggregators for each attestation committee.
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]*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 ¶
func (s *Service) ValidatorsByPubKey(ctx context.Context, stateID string, validatorPubKeys []phase0.BLSPubKey, ) ( map[phase0.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.
Source Files ¶
- aggregateattestation.go
- attestationdata.go
- attestationpool.go
- attesterduties.go
- beaconblockheader.go
- beaconblockproposal.go
- beaconblockroot.go
- beaconcommittees.go
- beaconcommitteesatepoch.go
- beaconstate.go
- blindedbeaconblockproposal.go
- client.go
- depositcontract.go
- domain.go
- events.go
- farfutureepoch.go
- finality.go
- fork.go
- forkschedule.go
- genesis.go
- genesistime.go
- metrics.go
- nodesyncing.go
- nodeversion.go
- parameters.go
- proposerduties.go
- service.go
- signedbeaconblock.go
- slotduration.go
- slotsperepoch.go
- spec.go
- stateroot.go
- submitaggregateattestations.go
- submitattestations.go
- submitbeaconblock.go
- submitbeaconcommitteesubscriptions.go
- submitblindedbeaconblock.go
- submitproposalpreparations.go
- submitsynccommitteecontributions.go
- submitsynccommitteemessages.go
- submitsynccommitteesubscriptions.go
- submitvalidatorregistrations.go
- submitvoluntaryexit.go
- synccommitteecontribution.go
- synccommitteeduties.go
- synccommittees.go
- targetaggregatorspercommittee.go
- validatorbalances.go
- validators.go
- validatorsbypubkey.go