Documentation ¶
Index ¶
- type Parameter
- type Service
- func (s *Service) Address() string
- func (s *Service) AggregateAndProofDomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) AggregateAttestation(_ context.Context, _ *api.AggregateAttestationOpts) (*api.Response[*phase0.Attestation], error)
- func (s *Service) AttestationData(_ context.Context, _ *api.AttestationDataOpts) (*api.Response[*phase0.AttestationData], error)
- func (s *Service) AttestationPool(_ context.Context, _ *api.AttestationPoolOpts) (*api.Response[[]*phase0.Attestation], error)
- func (s *Service) AttesterDuties(_ context.Context, opts *api.AttesterDutiesOpts) (*api.Response[[]*apiv1.AttesterDuty], error)
- func (s *Service) BeaconAttesterDomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) BeaconBlockHeader(_ context.Context, _ *api.BeaconBlockHeaderOpts) (*api.Response[*apiv1.BeaconBlockHeader], error)
- func (s *Service) BeaconBlockRoot(_ context.Context, _ *api.BeaconBlockRootOpts) (*api.Response[*phase0.Root], error)
- func (s *Service) BeaconCommittees(_ context.Context, _ *api.BeaconCommitteesOpts) (*api.Response[[]*apiv1.BeaconCommittee], error)
- func (s *Service) BeaconProposerDomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) BeaconState(_ context.Context, _ *api.BeaconStateOpts) (*api.Response[*spec.VersionedBeaconState], error)
- func (s *Service) BeaconStateRoot(_ context.Context, _ *api.BeaconStateRootOpts) (*api.Response[*phase0.Root], error)
- func (s *Service) BlindedProposal(_ context.Context, opts *api.BlindedProposalOpts) (*api.Response[*api.VersionedBlindedProposal], error)
- func (s *Service) DepositContract(_ context.Context) (*api.Response[*apiv1.DepositContract], error)
- func (s *Service) DepositDomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) Domain(ctx context.Context, domainType phase0.DomainType, epoch phase0.Epoch) (phase0.Domain, error)
- func (s *Service) Events(_ context.Context, _ []string, _ client.EventHandlerFunc) error
- func (s *Service) FarFutureEpoch(_ context.Context) (spec.Epoch, error)
- func (s *Service) Finality(_ context.Context, _ *api.FinalityOpts) (*api.Response[*apiv1.Finality], error)
- func (s *Service) Fork(ctx context.Context, _ *api.ForkOpts) (*api.Response[*phase0.Fork], error)
- func (s *Service) ForkSchedule(_ context.Context) (*api.Response[[]*spec.Fork], error)
- func (s *Service) Genesis(_ context.Context) (*api.Response[*apiv1.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) NodePeers(_ context.Context, _ *api.PeerOpts) (*api.Response[[]*apiv1.Peer], error)
- func (s *Service) NodeSyncing(_ context.Context) (*api.Response[*apiv1.SyncState], error)
- func (s *Service) NodeVersion(_ context.Context) (*api.Response[string], error)
- func (s *Service) Proposal(_ context.Context, opts *api.ProposalOpts) (*api.Response[*api.VersionedProposal], error)
- func (s *Service) ProposerDuties(_ context.Context, opts *api.ProposerDutiesOpts) (*api.Response[[]*apiv1.ProposerDuty], error)
- func (s *Service) RANDAODomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) SelectionProofDomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) SignedBeaconBlock(_ context.Context, _ *api.SignedBeaconBlockOpts) (*api.Response[*spec.VersionedSignedBeaconBlock], error)
- func (s *Service) SlotDuration(_ context.Context) (time.Duration, error)
- func (s *Service) SlotsPerEpoch(_ context.Context) (uint64, error)
- func (s *Service) Spec(_ context.Context) (*api.Response[map[string]any], error)
- func (s *Service) SubmitAggregateAttestations(_ context.Context, _ []*spec.SignedAggregateAndProof) error
- func (s *Service) SubmitAttestations(_ context.Context, _ []*spec.Attestation) error
- func (s *Service) SubmitAttesterSlashing(_ context.Context, _ *phase0.AttesterSlashing) error
- func (s *Service) SubmitBLSToExecutionChange(_ context.Context, _ *capella.SignedBLSToExecutionChange) error
- func (s *Service) SubmitBeaconBlock(_ context.Context, _ *spec.VersionedSignedBeaconBlock) error
- func (s *Service) SubmitBeaconCommitteeSubscriptions(_ context.Context, _ []*api.BeaconCommitteeSubscription) error
- func (s *Service) SubmitBlindedBeaconBlock(_ context.Context, _ *api.VersionedSignedBlindedBeaconBlock) error
- func (s *Service) SubmitProposal(_ context.Context, _ *api.VersionedSignedProposal) error
- func (s *Service) SubmitProposalPreparations(_ context.Context, _ []*apiv1.ProposalPreparation) error
- func (s *Service) SubmitProposalSlashing(_ context.Context, _ *phase0.ProposerSlashing) error
- func (s *Service) SubmitSyncCommitteeContributions(_ context.Context, _ []*altair.SignedContributionAndProof) error
- func (s *Service) SubmitSyncCommitteeMessages(_ context.Context, _ []*altair.SyncCommitteeMessage) error
- func (s *Service) SubmitSyncCommitteeSubscriptions(_ context.Context, _ []*api.SyncCommitteeSubscription) error
- func (s *Service) SubmitValidatorRegistrations(_ context.Context, _ []*api.VersionedSignedValidatorRegistration) error
- func (s *Service) SubmitVoluntaryExit(_ context.Context, _ *spec.SignedVoluntaryExit) error
- func (s *Service) SyncCommittee(_ context.Context, _ *api.SyncCommitteeOpts) (*api.Response[*apiv1.SyncCommittee], error)
- func (s *Service) SyncCommitteeContribution(_ context.Context, _ *api.SyncCommitteeContributionOpts) (*api.Response[*altair.SyncCommitteeContribution], error)
- func (s *Service) SyncCommitteeDuties(_ context.Context, opts *api.SyncCommitteeDutiesOpts) (*api.Response[[]*apiv1.SyncCommitteeDuty], error)
- func (s *Service) TargetAggregatorsPerCommittee(_ context.Context) (uint64, error)
- func (s *Service) ValidatorBalances(_ context.Context, _ *api.ValidatorBalancesOpts) (*api.Response[map[phase0.ValidatorIndex]phase0.Gwei], error)
- func (s *Service) Validators(_ context.Context, _ *api.ValidatorsOpts) (*api.Response[map[phase0.ValidatorIndex]*apiv1.Validator], error)
- func (s *Service) VoluntaryExitDomain(_ context.Context) (spec.DomainType, error)
- func (s *Service) VoluntaryExitPool(_ context.Context) ([]*spec.SignedVoluntaryExit, error)
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 WithGenesisTime ¶ added in v0.17.0
WithGenesisTime sets the genesis time for the mock.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithTimeout ¶
WithTimeout sets the maximum duration for all requests to the endpoint.
type Service ¶
type Service struct { // Values that can be altered if required. HeadSlot phase0.Slot SyncDistance phase0.Slot // contains filtered or unexported fields }
Service is a mock Ethereum 2 client service, providing data locally.
func (*Service) AggregateAndProofDomain ¶ added in v0.9.0
AggregateAndProofDomain provides the aggregate and proof domain.
func (*Service) AggregateAttestation ¶ added in v0.9.0
func (s *Service) AggregateAttestation(_ context.Context, _ *api.AggregateAttestationOpts, ) ( *api.Response[*phase0.Attestation], error, )
AggregateAttestation fetches the aggregate attestation given an attestation.
func (*Service) AttestationData ¶ added in v0.9.0
func (s *Service) AttestationData(_ context.Context, _ *api.AttestationDataOpts, ) ( *api.Response[*phase0.AttestationData], error, )
AttestationData fetches the attestation data for the given slot and committee index.
func (*Service) AttestationPool ¶ added in v0.9.0
func (s *Service) AttestationPool(_ context.Context, _ *api.AttestationPoolOpts, ) ( *api.Response[[]*phase0.Attestation], error, )
AttestationPool fetches the attestation pool for the given slot.
func (*Service) AttesterDuties ¶ added in v0.9.0
func (s *Service) AttesterDuties(_ context.Context, opts *api.AttesterDutiesOpts) (*api.Response[[]*apiv1.AttesterDuty], error)
AttesterDuties obtains attester duties. If validatorIndicess is nil it will return all duties for the given epoch.
func (*Service) BeaconAttesterDomain ¶ added in v0.9.0
BeaconAttesterDomain provides the beacon attester domain.
func (*Service) BeaconBlockHeader ¶ added in v0.9.0
func (s *Service) BeaconBlockHeader(_ context.Context, _ *api.BeaconBlockHeaderOpts, ) ( *api.Response[*apiv1.BeaconBlockHeader], error, )
BeaconBlockHeader provides the block header of a given block ID.
func (*Service) BeaconBlockRoot ¶ added in v0.7.0
func (s *Service) BeaconBlockRoot(_ context.Context, _ *api.BeaconBlockRootOpts, ) ( *api.Response[*phase0.Root], error, )
BeaconBlockRoot fetches a block's root given a block ID.
func (*Service) BeaconCommittees ¶ added in v0.9.0
func (s *Service) BeaconCommittees(_ context.Context, _ *api.BeaconCommitteesOpts, ) ( *api.Response[[]*apiv1.BeaconCommittee], error, )
BeaconCommittees fetches all beacon committees for the epoch at the given state.
func (*Service) BeaconProposerDomain ¶ added in v0.9.0
BeaconProposerDomain provides the beacon proposer domain.
func (*Service) BeaconState ¶ added in v0.9.0
func (s *Service) BeaconState(_ context.Context, _ *api.BeaconStateOpts) (*api.Response[*spec.VersionedBeaconState], error)
BeaconState fetches a beacon state given a state ID.
func (*Service) BeaconStateRoot ¶ added in v0.9.0
func (s *Service) BeaconStateRoot(_ context.Context, _ *api.BeaconStateRootOpts) (*api.Response[*phase0.Root], error)
BeaconStateRoot fetches a beacon state's root given a state ID.
func (*Service) BlindedProposal ¶ added in v0.19.0
func (s *Service) BlindedProposal(_ context.Context, opts *api.BlindedProposalOpts, ) ( *api.Response[*api.VersionedBlindedProposal], error, )
BlindedProposal fetches a blinded proposal for signing.
func (*Service) DepositContract ¶ added in v0.9.0
DepositContract provides details of the execution layer deposit contract for the chain.
func (*Service) DepositDomain ¶ added in v0.9.0
DepositDomain provides the deposit domain.
func (*Service) Domain ¶ added in v0.9.0
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 ¶ added in v0.9.0
Events feeds requested events with the given topics to the supplied handler.
func (*Service) FarFutureEpoch ¶ added in v0.9.0
FarFutureEpoch provides the values for FAR_FUTURE_EOPCH of the chain.
func (*Service) Finality ¶ added in v0.9.0
func (s *Service) Finality(_ context.Context, _ *api.FinalityOpts) (*api.Response[*apiv1.Finality], error)
Finality provides the finality given a state ID.
func (*Service) ForkSchedule ¶ added in v0.9.0
ForkSchedule provides details of past and future changes in the chain's fork version.
func (*Service) GenesisDomain ¶ added in v0.15.5
func (s *Service) GenesisDomain(ctx context.Context, domainType phase0.DomainType) (phase0.Domain, error)
GenesisDomain returns the domain for the given domain type at genesis. N.B. this is not always the same as the domain at epoch 0. It is possible for a chain's fork schedule to have multiple forks at genesis. In this situation, GenesisDomain() will return the first, and Domain() will return the last.
func (*Service) GenesisTime ¶ added in v0.9.0
GenesisTime provides the genesis time of the chain.
func (*Service) NodePeers ¶ added in v0.19.0
func (s *Service) NodePeers(_ context.Context, _ *api.PeerOpts) (*api.Response[[]*apiv1.Peer], error)
NodePeers provides the peers of the node.
func (*Service) NodeSyncing ¶ added in v0.6.25
NodeSyncing provides the state of the node's synchronization with the chain.
func (*Service) NodeVersion ¶ added in v0.9.0
NodeVersion returns a free-text string with the node version.
func (*Service) Proposal ¶ added in v0.19.0
func (s *Service) Proposal(_ context.Context, opts *api.ProposalOpts, ) ( *api.Response[*api.VersionedProposal], error, )
Proposal fetches a proposal for signing.
func (*Service) ProposerDuties ¶ added in v0.9.0
func (s *Service) ProposerDuties(_ context.Context, opts *api.ProposerDutiesOpts) (*api.Response[[]*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) RANDAODomain ¶ added in v0.9.0
RANDAODomain provides the RANDAO domain.
func (*Service) SelectionProofDomain ¶ added in v0.9.0
SelectionProofDomain provides the selection proof domain.
func (*Service) SignedBeaconBlock ¶ added in v0.9.0
func (s *Service) SignedBeaconBlock(_ context.Context, _ *api.SignedBeaconBlockOpts) (*api.Response[*spec.VersionedSignedBeaconBlock], error)
SignedBeaconBlock fetches a signed beacon block given a block ID.
func (*Service) SlotDuration ¶ added in v0.9.0
SlotDuration provides the duration of a slot of the chain.
func (*Service) SlotsPerEpoch ¶ added in v0.9.0
SlotsPerEpoch provides the slots per epoch of the chain.
func (*Service) Spec ¶ added in v0.9.0
Spec provides the spec information of the chain. This returns various useful values.
func (*Service) SubmitAggregateAttestations ¶ added in v0.9.0
func (s *Service) SubmitAggregateAttestations(_ context.Context, _ []*spec.SignedAggregateAndProof) error
SubmitAggregateAttestations submits aggregate attestations.
func (*Service) SubmitAttestations ¶ added in v0.9.0
SubmitAttestations submits attestations.
func (*Service) SubmitAttesterSlashing ¶ added in v0.19.0
SubmitAttesterSlashing submits a proposal slashing.
func (*Service) SubmitBLSToExecutionChange ¶ added in v0.14.0
func (s *Service) SubmitBLSToExecutionChange(_ context.Context, _ *capella.SignedBLSToExecutionChange) error
SubmitBLSToExecutionChange submits a BLS to execution address change operation.
func (*Service) SubmitBeaconBlock ¶ added in v0.9.0
SubmitBeaconBlock submits a beacon block.
func (*Service) SubmitBeaconCommitteeSubscriptions ¶ added in v0.9.0
func (s *Service) SubmitBeaconCommitteeSubscriptions(_ context.Context, _ []*api.BeaconCommitteeSubscription) error
SubmitBeaconCommitteeSubscriptions subscribes to beacon committees.
func (*Service) SubmitBlindedBeaconBlock ¶ added in v0.11.6
func (s *Service) SubmitBlindedBeaconBlock(_ context.Context, _ *api.VersionedSignedBlindedBeaconBlock) error
SubmitBlindedBeaconBlock submits a blinded beacon block.
func (*Service) SubmitProposal ¶ added in v0.19.0
SubmitProposal submits a proposal.
func (*Service) SubmitProposalPreparations ¶ added in v0.11.6
func (s *Service) SubmitProposalPreparations(_ context.Context, _ []*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) SubmitProposalSlashing ¶ added in v0.19.0
SubmitProposalSlashing submits a proposal slashing.
func (*Service) SubmitSyncCommitteeContributions ¶ added in v0.9.2
func (s *Service) SubmitSyncCommitteeContributions(_ context.Context, _ []*altair.SignedContributionAndProof) error
SubmitSyncCommitteeContributions submits sync committee contributions.
func (*Service) SubmitSyncCommitteeMessages ¶ added in v0.9.0
func (s *Service) SubmitSyncCommitteeMessages(_ context.Context, _ []*altair.SyncCommitteeMessage) error
SubmitSyncCommitteeMessages submits sync committee messages.
func (*Service) SubmitSyncCommitteeSubscriptions ¶ added in v0.9.0
func (s *Service) SubmitSyncCommitteeSubscriptions(_ context.Context, _ []*api.SyncCommitteeSubscription) error
SubmitSyncCommitteeSubscriptions subscribes to sync committees.
func (*Service) SubmitValidatorRegistrations ¶ added in v0.12.0
func (s *Service) SubmitValidatorRegistrations(_ context.Context, _ []*api.VersionedSignedValidatorRegistration) error
SubmitValidatorRegistrations submits a validator registration.
func (*Service) SubmitVoluntaryExit ¶ added in v0.9.0
SubmitVoluntaryExit submits a voluntary exit.
func (*Service) SyncCommittee ¶ added in v0.9.2
func (s *Service) SyncCommittee(_ context.Context, _ *api.SyncCommitteeOpts) (*api.Response[*apiv1.SyncCommittee], error)
SyncCommittee fetches the sync committee for the given state.
func (*Service) SyncCommitteeContribution ¶ added in v0.7.0
func (s *Service) SyncCommitteeContribution(_ context.Context, _ *api.SyncCommitteeContributionOpts) (*api.Response[*altair.SyncCommitteeContribution], error)
SyncCommitteeContribution provides a sync committee contribution.
func (*Service) SyncCommitteeDuties ¶ added in v0.9.0
func (s *Service) SyncCommitteeDuties(_ context.Context, opts *api.SyncCommitteeDutiesOpts) (*api.Response[[]*apiv1.SyncCommitteeDuty], error)
SyncCommitteeDuties obtains sync committee duties.
func (*Service) TargetAggregatorsPerCommittee ¶ added in v0.9.0
TargetAggregatorsPerCommittee provides the target number of aggregators for each attestation committee.
func (*Service) ValidatorBalances ¶ added in v0.9.0
func (s *Service) ValidatorBalances(_ context.Context, _ *api.ValidatorBalancesOpts) (*api.Response[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 ¶ added in v0.8.1
func (s *Service) Validators(_ context.Context, _ *api.ValidatorsOpts) (*api.Response[map[phase0.ValidatorIndex]*apiv1.Validator], error)
Validators provides the validators, with their balance and status, for a given state.
func (*Service) VoluntaryExitDomain ¶ added in v0.9.0
VoluntaryExitDomain provides the voluntary exit domain.
func (*Service) VoluntaryExitPool ¶ added in v0.18.2
VoluntaryExitPool fetches the voluntary exit pool.
Source Files ¶
- aggregateandproofdomain.go
- aggregateattestation.go
- attestationdata.go
- attestationpool.go
- attesterduties.go
- beaconattesterdomain.go
- beaconblockheader.go
- beaconblockroot.go
- beaconcommittees.go
- beaconproposerdomain.go
- beaconstate.go
- beaconstateroot.go
- blindedproposal.go
- depositcontract.go
- depositdomain.go
- domain.go
- events.go
- farfutureepoch.go
- finality.go
- fork.go
- forkschedule.go
- genesis.go
- genesistime.go
- nodepeers.go
- nodesyncing.go
- nodeversion.go
- parameters.go
- proposal.go
- proposerduties.go
- randaodomain.go
- selectionproofdomain.go
- service.go
- signedbeaconblock.go
- slotduration.go
- slotsperepoch.go
- spec.go
- submitaggregateattestations.go
- submitattestations.go
- submitattesterslashing.go
- submitbeaconblock.go
- submitbeaconcommitteesubscriptions.go
- submitblindedbeaconblock.go
- submitblstoexecutionchange.go
- submitproposal.go
- submitproposalpreparations.go
- submitproposalslashing.go
- submitsynccommitteecontributions.go
- submitsynccommitteemessages.go
- submitsynccommitteesubscriptions.go
- submitvalidatorregistration.go
- submitvoluntaryexit.go
- synccommittee.go
- synccommitteecontributionprovider.go
- synccommitteeduties.go
- targetaggregatorspercommittee.go
- validatorbalances.go
- validators.go
- voluntaryexitdomain.go
- voluntaryexitpool.go