Documentation ¶
Index ¶
- func New(ctx context.Context, params ...Parameter) (eth2client.Service, error)
- type ContentType
- type Parameter
- func WithAddress(address string) Parameter
- func WithEnforceJSON(enforceJSON bool) Parameter
- func WithExtraHeaders(headers map[string]string) Parameter
- func WithIndexChunkSize(indexChunkSize int) Parameter
- func WithLogLevel(logLevel zerolog.Level) Parameter
- func WithPubKeyChunkSize(pubKeyChunkSize int) Parameter
- func WithTimeout(timeout time.Duration) Parameter
- type Service
- func (s *Service) Address() string
- func (s *Service) AggregateAttestation(ctx context.Context, opts *api.AggregateAttestationOpts) (*api.Response[*phase0.Attestation], error)
- func (s *Service) AttestationData(ctx context.Context, opts *api.AttestationDataOpts) (*api.Response[*phase0.AttestationData], error)
- func (s *Service) AttestationPool(ctx context.Context, opts *api.AttestationPoolOpts) (*api.Response[[]*phase0.Attestation], error)
- func (s *Service) AttesterDuties(ctx context.Context, opts *api.AttesterDutiesOpts) (*api.Response[[]*apiv1.AttesterDuty], error)
- func (s *Service) BeaconBlockHeader(ctx context.Context, opts *api.BeaconBlockHeaderOpts) (*api.Response[*apiv1.BeaconBlockHeader], error)
- func (s *Service) BeaconBlockRoot(ctx context.Context, opts *api.BeaconBlockRootOpts) (*api.Response[*phase0.Root], error)
- func (s *Service) BeaconCommittees(ctx context.Context, opts *api.BeaconCommitteesOpts) (*api.Response[[]*apiv1.BeaconCommittee], error)
- func (s *Service) BeaconState(ctx context.Context, opts *api.BeaconStateOpts) (*api.Response[*spec.VersionedBeaconState], error)
- func (s *Service) BeaconStateRandao(ctx context.Context, opts *api.BeaconStateRandaoOpts) (*api.Response[*phase0.Root], error)
- func (s *Service) BeaconStateRoot(ctx context.Context, opts *api.BeaconStateRootOpts) (*api.Response[*phase0.Root], error)
- func (s *Service) BlindedProposal(ctx context.Context, opts *api.BlindedProposalOpts) (*api.Response[*api.VersionedBlindedProposal], error)
- func (s *Service) BlobSidecars(ctx context.Context, opts *api.BlobSidecarsOpts) (*api.Response[[]*deneb.BlobSidecar], error)
- func (s *Service) DepositContract(ctx context.Context) (*api.Response[*apiv1.DepositContract], error)
- func (s *Service) Domain(ctx context.Context, domainType phase0.DomainType, epoch phase0.Epoch) (phase0.Domain, error)
- func (s *Service) EpochFromStateID(ctx context.Context, stateID string) (phase0.Epoch, error)
- func (s *Service) Events(ctx context.Context, topics []string, handler client.EventHandlerFunc) error
- func (s *Service) FarFutureEpoch(_ context.Context) (phase0.Epoch, error)
- func (s *Service) Finality(ctx context.Context, opts *api.FinalityOpts) (*api.Response[*apiv1.Finality], error)
- func (s *Service) Fork(ctx context.Context, opts *api.ForkOpts) (*api.Response[*phase0.Fork], error)
- func (s *Service) ForkChoice(ctx context.Context) (*api.Response[*apiv1.ForkChoice], error)
- func (s *Service) ForkSchedule(ctx context.Context) (*api.Response[[]*phase0.Fork], error)
- func (s *Service) Genesis(ctx 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) NodeClient(ctx context.Context) (*api.Response[string], error)
- func (s *Service) NodePeers(ctx context.Context, opts *api.PeerOpts) (*api.Response[[]*apiv1.Peer], error)
- func (s *Service) NodeSyncing(ctx context.Context) (*api.Response[*apiv1.SyncState], error)
- func (s *Service) NodeVersion(ctx context.Context) (*api.Response[string], error)
- func (s *Service) Proposal(ctx context.Context, opts *api.ProposalOpts) (*api.Response[*api.VersionedProposal], error)
- func (s *Service) ProposerDuties(ctx context.Context, opts *api.ProposerDutiesOpts) (*api.Response[[]*apiv1.ProposerDuty], error)
- func (s *Service) SignedBeaconBlock(ctx context.Context, opts *api.SignedBeaconBlockOpts) (*api.Response[*spec.VersionedSignedBeaconBlock], error)
- func (s *Service) SlotDuration(ctx context.Context) (time.Duration, error)
- func (s *Service) SlotFromStateID(_ context.Context, stateID string) (phase0.Slot, error)
- func (s *Service) SlotsPerEpoch(ctx context.Context) (uint64, error)
- func (s *Service) Spec(ctx context.Context) (*api.Response[map[string]any], 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) SubmitAttesterSlashing(ctx context.Context, slashing *phase0.AttesterSlashing) error
- func (s *Service) SubmitBLSToExecutionChanges(ctx context.Context, ...) error
- func (s *Service) SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSignedBeaconBlock) errordeprecated
- func (s *Service) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*api.BeaconCommitteeSubscription) error
- func (s *Service) SubmitBlindedBeaconBlock(ctx context.Context, block *api.VersionedSignedBlindedBeaconBlock) errordeprecated
- func (s *Service) SubmitBlindedProposal(ctx context.Context, proposal *api.VersionedSignedBlindedProposal) error
- func (s *Service) SubmitProposal(ctx context.Context, proposal *api.VersionedSignedProposal) error
- func (s *Service) SubmitProposalPreparations(ctx context.Context, preparations []*apiv1.ProposalPreparation) error
- func (s *Service) SubmitProposalSlashing(ctx context.Context, slashing phase0.ProposerSlashing) 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, opts *api.SyncCommitteeOpts) (*api.Response[*apiv1.SyncCommittee], error)
- func (s *Service) SyncCommitteeContribution(ctx context.Context, opts *api.SyncCommitteeContributionOpts) (*api.Response[*altair.SyncCommitteeContribution], error)
- func (s *Service) SyncCommitteeDuties(ctx context.Context, opts *api.SyncCommitteeDutiesOpts) (*api.Response[[]*apiv1.SyncCommitteeDuty], error)
- func (s *Service) TargetAggregatorsPerCommittee(ctx context.Context) (uint64, error)
- func (s *Service) ValidatorBalances(ctx context.Context, opts *api.ValidatorBalancesOpts) (*api.Response[map[phase0.ValidatorIndex]phase0.Gwei], error)
- func (s *Service) Validators(ctx context.Context, opts *api.ValidatorsOpts) (*api.Response[map[phase0.ValidatorIndex]*apiv1.Validator], error)
- func (s *Service) VoluntaryExitPool(ctx context.Context) ([]*phase0.SignedVoluntaryExit, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContentType ¶ added in v0.18.0
type ContentType int
ContentType defines the builder spec version.
const ( // ContentTypeUnknown implies an unknown content type. ContentTypeUnknown ContentType = iota // ContentTypeSSZ implies an SSZ content type. ContentTypeSSZ // ContentTypeJSON implies a JSON content type. ContentTypeJSON )
func ParseFromMediaType ¶ added in v0.18.0
func ParseFromMediaType(input string) (ContentType, error)
ParseFromMediaType parses a content type string as per http://www.iana.org/assignments/media-types/media-types.xhtml
func (*ContentType) MarshalJSON ¶ added in v0.18.0
func (c *ContentType) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (ContentType) MediaType ¶ added in v0.18.0
func (c ContentType) MediaType() string
MediaType returns the IANA name of the media type.
func (ContentType) String ¶ added in v0.18.0
func (c ContentType) String() string
String returns a string representation of the struct.
func (*ContentType) UnmarshalJSON ¶ added in v0.18.0
func (c *ContentType) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithAddress ¶
WithAddress provides the address for the endpoint.
func WithEnforceJSON ¶ added in v0.19.0
WithEnforceJSON forces all requests and responses to be in JSON, not sending or requesting SSZ.
func WithExtraHeaders ¶ added in v0.15.4
WithExtraHeaders sets additional headers to be sent with each HTTP request.
func WithIndexChunkSize ¶ added in v0.8.1
WithIndexChunkSize sets the maximum number of indices to send for individual validator requests.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithPubKeyChunkSize ¶ added in v0.8.1
WithPubKeyChunkSize sets the maximum number of public kyes to send for individual validator requests.
func WithTimeout ¶
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 (*Service) AggregateAttestation ¶
func (s *Service) AggregateAttestation(ctx context.Context, opts *api.AggregateAttestationOpts, ) ( *api.Response[*phase0.Attestation], error, )
AggregateAttestation fetches the aggregate attestation for the given options.
func (*Service) AttestationData ¶
func (s *Service) AttestationData(ctx context.Context, opts *api.AttestationDataOpts, ) ( *api.Response[*phase0.AttestationData], error, )
AttestationData obtains attestation data given the options.
func (*Service) AttestationPool ¶
func (s *Service) AttestationPool(ctx context.Context, opts *api.AttestationPoolOpts, ) ( *api.Response[[]*phase0.Attestation], error, )
AttestationPool obtains the attestation pool for the given options.
func (*Service) AttesterDuties ¶
func (s *Service) AttesterDuties(ctx context.Context, opts *api.AttesterDutiesOpts, ) ( *api.Response[[]*apiv1.AttesterDuty], error, )
AttesterDuties obtains attester duties.
func (*Service) BeaconBlockHeader ¶
func (s *Service) BeaconBlockHeader(ctx context.Context, opts *api.BeaconBlockHeaderOpts, ) ( *api.Response[*apiv1.BeaconBlockHeader], error, )
BeaconBlockHeader provides the block header given the opts.
func (*Service) BeaconBlockRoot ¶
func (s *Service) BeaconBlockRoot(ctx context.Context, opts *api.BeaconBlockRootOpts, ) ( *api.Response[*phase0.Root], error, )
BeaconBlockRoot fetches a block's root given a set of options.
func (*Service) BeaconCommittees ¶
func (s *Service) BeaconCommittees(ctx context.Context, opts *api.BeaconCommitteesOpts, ) ( *api.Response[[]*apiv1.BeaconCommittee], error, )
BeaconCommittees fetches all beacon committees for the epoch at the given state.
func (*Service) BeaconState ¶
func (s *Service) BeaconState(ctx context.Context, opts *api.BeaconStateOpts, ) ( *api.Response[*spec.VersionedBeaconState], error, )
BeaconState fetches a beacon state.
func (*Service) BeaconStateRandao ¶ added in v0.14.1
func (s *Service) BeaconStateRandao(ctx context.Context, opts *api.BeaconStateRandaoOpts) (*api.Response[*phase0.Root], error)
BeaconStateRandao fetches the beacon state RANDAO given a set of options.
func (*Service) BeaconStateRoot ¶ added in v0.9.0
func (s *Service) BeaconStateRoot(ctx context.Context, opts *api.BeaconStateRootOpts) (*api.Response[*phase0.Root], error)
BeaconStateRoot fetches the beacon state root given a set of options.
func (*Service) BlindedProposal ¶ added in v0.19.0
func (s *Service) BlindedProposal(ctx context.Context, opts *api.BlindedProposalOpts, ) ( *api.Response[*api.VersionedBlindedProposal], error, )
BlindedProposal fetches a proposal for signing.
func (*Service) BlobSidecars ¶ added in v0.19.0
func (s *Service) BlobSidecars(ctx context.Context, opts *api.BlobSidecarsOpts, ) ( *api.Response[[]*deneb.BlobSidecar], error, )
BlobSidecars fetches the blobs sidecars given options.
func (*Service) DepositContract ¶
func (s *Service) DepositContract(ctx context.Context) (*api.Response[*apiv1.DepositContract], error)
DepositContract provides details of the execution 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) EpochFromStateID ¶
EpochFromStateID parses the state ID and returns the relevant epoch.
func (*Service) Events ¶
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 ¶
FarFutureEpoch provides the values for FAR_FUTURE_EOPCH of the chain.
func (*Service) Finality ¶
func (s *Service) Finality(ctx context.Context, opts *api.FinalityOpts, ) ( *api.Response[*apiv1.Finality], error, )
Finality provides the finality given a state ID.
func (*Service) Fork ¶
func (s *Service) Fork(ctx context.Context, opts *api.ForkOpts, ) ( *api.Response[*phase0.Fork], error, )
Fork fetches fork information for the given options.
func (*Service) ForkChoice ¶ added in v0.18.1
ForkChoice fetches all current fork choice context.
func (*Service) ForkSchedule ¶
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 ¶
GenesisTime provides the genesis time of the chain.
func (*Service) NodeClient ¶ added in v0.11.7
NodeClient provides the client for the node.
func (*Service) NodePeers ¶ added in v0.19.0
func (s *Service) NodePeers(ctx context.Context, opts *api.PeerOpts) (*api.Response[[]*apiv1.Peer], error)
NodePeers obtains the peers of a node.
func (*Service) NodeSyncing ¶
NodeSyncing provides the syncing information for the node.
func (*Service) NodeVersion ¶
NodeVersion provides the version information of the node.
func (*Service) Proposal ¶ added in v0.19.0
func (s *Service) Proposal(ctx context.Context, opts *api.ProposalOpts, ) ( *api.Response[*api.VersionedProposal], error, )
Proposal fetches a potential beacon block for signing.
func (*Service) ProposerDuties ¶
func (s *Service) ProposerDuties(ctx context.Context, opts *api.ProposerDutiesOpts, ) ( *api.Response[[]*apiv1.ProposerDuty], error, )
ProposerDuties obtains proposer duties for the given options.
func (*Service) SignedBeaconBlock ¶
func (s *Service) SignedBeaconBlock(ctx context.Context, opts *api.SignedBeaconBlockOpts, ) ( *api.Response[*spec.VersionedSignedBeaconBlock], error, )
SignedBeaconBlock fetches a signed beacon block given a block ID.
func (*Service) SlotDuration ¶
SlotDuration provides the duration of a slot for the chain.
func (*Service) SlotFromStateID ¶
SlotFromStateID parses the state ID and returns the relevant slot.
func (*Service) SlotsPerEpoch ¶
SlotsPerEpoch provides the number of slots per epoch for the chain.
func (*Service) SubmitAggregateAttestations ¶
func (s *Service) SubmitAggregateAttestations(ctx context.Context, aggregateAndProofs []*phase0.SignedAggregateAndProof) error
SubmitAggregateAttestations submits aggregate attestations.
func (*Service) SubmitAttestations ¶
SubmitAttestations submits attestations.
func (*Service) SubmitAttesterSlashing ¶ added in v0.19.0
func (s *Service) SubmitAttesterSlashing(ctx context.Context, slashing *phase0.AttesterSlashing) error
SubmitAttesterSlashing submits an attester slashing.
func (*Service) SubmitBLSToExecutionChanges ¶ added in v0.15.0
func (s *Service) SubmitBLSToExecutionChanges(ctx context.Context, blsToExecutionChanges []*capella.SignedBLSToExecutionChange) error
SubmitBLSToExecutionChanges submits BLS to execution address change operations.
func (*Service) SubmitBeaconBlock
deprecated
func (*Service) SubmitBeaconCommitteeSubscriptions ¶
func (s *Service) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*api.BeaconCommitteeSubscription) error
SubmitBeaconCommitteeSubscriptions subscribes to beacon committees.
func (*Service) SubmitBlindedBeaconBlock
deprecated
added in
v0.11.0
func (*Service) SubmitBlindedProposal ¶ added in v0.19.0
func (s *Service) SubmitBlindedProposal(ctx context.Context, proposal *api.VersionedSignedBlindedProposal) error
SubmitBlindedProposal submits a blinded proposal.
func (*Service) SubmitProposal ¶ added in v0.19.0
SubmitProposal submits a proposal.
func (*Service) SubmitProposalPreparations ¶ added in v0.11.0
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) SubmitProposalSlashing ¶ added in v0.19.0
func (s *Service) SubmitProposalSlashing(ctx context.Context, slashing phase0.ProposerSlashing) error
SubmitProposalSlashing submits a proposal slashing.
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 ¶ added in v0.12.0
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 ¶
func (s *Service) SyncCommittee(ctx context.Context, opts *api.SyncCommitteeOpts, ) ( *api.Response[*apiv1.SyncCommittee], error, )
SyncCommittee fetches the sync committee for epoch at the given state.
func (*Service) SyncCommitteeContribution ¶
func (s *Service) SyncCommitteeContribution(ctx context.Context, opts *api.SyncCommitteeContributionOpts, ) ( *api.Response[*altair.SyncCommitteeContribution], error, )
SyncCommitteeContribution provides a sync committee contribution.
func (*Service) SyncCommitteeDuties ¶
func (s *Service) SyncCommitteeDuties(ctx context.Context, opts *api.SyncCommitteeDutiesOpts, ) ( *api.Response[[]*apiv1.SyncCommitteeDuty], error, )
SyncCommitteeDuties obtains sync committee duties.
func (*Service) TargetAggregatorsPerCommittee ¶
TargetAggregatorsPerCommittee provides the target aggregators per committee of the chain.
func (*Service) ValidatorBalances ¶
func (s *Service) ValidatorBalances(ctx context.Context, opts *api.ValidatorBalancesOpts, ) ( *api.Response[map[phase0.ValidatorIndex]phase0.Gwei], error, )
ValidatorBalances provides the validator balances for the given options.
func (*Service) Validators ¶
func (s *Service) Validators(ctx context.Context, opts *api.ValidatorsOpts, ) ( *api.Response[map[phase0.ValidatorIndex]*apiv1.Validator], error, )
Validators provides the validators, with their balance and status, for the given options.
func (*Service) VoluntaryExitPool ¶ added in v0.18.2
VoluntaryExitPool obtains the voluntary exit pool.
Source Files ¶
- aggregateattestation.go
- attestationdata.go
- attestationpool.go
- attesterduties.go
- beaconblockheader.go
- beaconblockroot.go
- beaconcommittees.go
- beaconstate.go
- beaconstaterandao.go
- beaconstateroot.go
- blindedproposal.go
- blobsidecars.go
- contenttype.go
- depositcontract.go
- domain.go
- events.go
- farfutureepoch.go
- finality.go
- fork.go
- forkchoice.go
- forkschedule.go
- genesis.go
- genesistime.go
- http.go
- json.go
- nodeclient.go
- nodepeers.go
- nodesyncing.go
- nodeversion.go
- parameters.go
- proposal.go
- proposerduties.go
- service.go
- signedbeaconblock.go
- slotduration.go
- slotsperepoch.go
- spec.go
- stateid.go
- submitaggregateattestations.go
- submitattestations.go
- submitattesterslashing.go
- submitbeaconblock.go
- submitbeaconcommitteesubscriptions.go
- submitblindedbeaconblock.go
- submitblindedproposal.go
- submitblstoexecutionchanges.go
- submitproposal.go
- submitproposalpreparation.go
- submitproposalslashing.go
- submitsynccommitteecontributions.go
- submitsynccommitteemessages.go
- submitsynccommitteesubscriptions.go
- submitvalidatorregistrations.go
- submitvoluntaryexit.go
- synccommittee.go
- synccommitteecontribution.go
- synccommitteeduties.go
- targetaggregatorspercommittee.go
- validatorbalances.go
- validators.go
- voluntaryexitpool.go