Documentation ¶
Index ¶
- Variables
- type Parameter
- func WithCACert(cert []byte) Parameter
- func WithClientCert(cert []byte) Parameter
- func WithClientKey(key []byte) Parameter
- func WithConnectionURL(connectionURL string) Parameter
- func WithLogLevel(logLevel zerolog.Level) Parameter
- func WithPassword(password string) Parameter
- func WithPort(port int32) Parameter
- func WithServer(server string) Parameter
- func WithUser(user string) Parameter
- type Service
- func (s *Service) AggregateValidatorBalancesByIndexAndEpoch(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) (*chaindb.AggregateValidatorBalance, error)
- func (s *Service) AggregateValidatorBalancesByIndexAndEpochRange(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) ([]*chaindb.AggregateValidatorBalance, error)
- func (s *Service) AggregateValidatorBalancesByIndexAndEpochs(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) ([]*chaindb.AggregateValidatorBalance, error)
- func (s *Service) AttestationsForBlock(ctx context.Context, blockRoot phase0.Root) ([]*chaindb.Attestation, error)
- func (s *Service) AttestationsForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.Attestation, error)
- func (s *Service) AttestationsInBlock(ctx context.Context, blockRoot phase0.Root) ([]*chaindb.Attestation, error)
- func (s *Service) AttestationsInSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.Attestation, error)
- func (s *Service) AttesterDuties(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot, ...) ([]*chaindb.AttesterDuty, error)
- func (s *Service) AttesterSlashingsForSlotRange(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]*chaindb.AttesterSlashing, error)
- func (s *Service) AttesterSlashingsForValidator(ctx context.Context, index phase0.ValidatorIndex) ([]*chaindb.AttesterSlashing, error)
- func (s *Service) BeaconCommitteeBySlotAndIndex(ctx context.Context, slot phase0.Slot, index phase0.CommitteeIndex) (*chaindb.BeaconCommittee, error)
- func (s *Service) BeginTx(ctx context.Context) (context.Context, context.CancelFunc, error)
- func (s *Service) BlockByRoot(ctx context.Context, root phase0.Root) (*chaindb.Block, error)
- func (s *Service) BlockSummaryForSlot(ctx context.Context, slot phase0.Slot) (*chaindb.BlockSummary, error)
- func (s *Service) BlocksByParentRoot(ctx context.Context, parentRoot phase0.Root) ([]*chaindb.Block, error)
- func (s *Service) BlocksBySlot(ctx context.Context, slot phase0.Slot) ([]*chaindb.Block, error)
- func (s *Service) BlocksForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.Block, error)
- func (s *Service) CanonicalBlockPresenceForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]bool, error)
- func (s *Service) ChainSpec(ctx context.Context) (map[string]interface{}, error)
- func (s *Service) ChainSpecValue(ctx context.Context, key string) (interface{}, error)
- func (s *Service) CommitTx(ctx context.Context) error
- func (s *Service) DepositsByPublicKey(ctx context.Context, pubKeys []phase0.BLSPubKey) (map[phase0.BLSPubKey][]*chaindb.Deposit, error)
- func (s *Service) DepositsForSlotRange(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]*chaindb.Deposit, error)
- func (s *Service) ETH1DepositsByPublicKey(ctx context.Context, pubKeys []phase0.BLSPubKey) ([]*chaindb.ETH1Deposit, error)
- func (s *Service) EmptySlots(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]phase0.Slot, error)
- func (s *Service) ForkSchedule(ctx context.Context) ([]*phase0.Fork, error)
- func (s *Service) Genesis(ctx context.Context) (*api.Genesis, error)
- func (s *Service) GenesisTime(ctx context.Context) (time.Time, error)
- func (s *Service) IndeterminateAttestationSlots(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]phase0.Slot, error)
- func (s *Service) IndeterminateBlocks(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]phase0.Root, error)
- func (s *Service) Init(ctx context.Context) (bool, error)
- func (s *Service) LatestBlocks(ctx context.Context) ([]*chaindb.Block, error)
- func (s *Service) LatestCanonicalBlock(ctx context.Context) (phase0.Slot, error)
- func (s *Service) Metadata(ctx context.Context, key string) ([]byte, error)
- func (s *Service) ProposalCount(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) (uint64, error)
- func (s *Service) ProposerDutiesForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.ProposerDuty, error)
- func (s *Service) ProposerDutiesForValidator(ctx context.Context, proposer phase0.ValidatorIndex) ([]*chaindb.ProposerDuty, error)
- func (s *Service) ProposerSlashingsForSlotRange(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]*chaindb.ProposerSlashing, error)
- func (s *Service) ProposerSlashingsForValidator(ctx context.Context, index phase0.ValidatorIndex) ([]*chaindb.ProposerSlashing, error)
- func (s *Service) SetAttestation(ctx context.Context, attestation *chaindb.Attestation) error
- func (s *Service) SetAttesterSlashing(ctx context.Context, attesterSlashing *chaindb.AttesterSlashing) error
- func (s *Service) SetBeaconCommittee(ctx context.Context, beaconCommittee *chaindb.BeaconCommittee) error
- func (s *Service) SetBlock(ctx context.Context, block *chaindb.Block) error
- func (s *Service) SetBlockSummary(ctx context.Context, summary *chaindb.BlockSummary) error
- func (s *Service) SetChainSpecValue(ctx context.Context, key string, value interface{}) error
- func (s *Service) SetDeposit(ctx context.Context, deposit *chaindb.Deposit) error
- func (s *Service) SetETH1Deposit(ctx context.Context, deposit *chaindb.ETH1Deposit) error
- func (s *Service) SetEpochSummary(ctx context.Context, summary *chaindb.EpochSummary) error
- func (s *Service) SetForkSchedule(ctx context.Context, schedule []*phase0.Fork) error
- func (s *Service) SetGenesis(ctx context.Context, genesis *api.Genesis) error
- func (s *Service) SetMetadata(ctx context.Context, key string, value []byte) error
- func (s *Service) SetProposerDuty(ctx context.Context, proposerDuty *chaindb.ProposerDuty) error
- func (s *Service) SetProposerSlashing(ctx context.Context, proposerSlashing *chaindb.ProposerSlashing) error
- func (s *Service) SetSyncAggregate(ctx context.Context, syncAggregate *chaindb.SyncAggregate) error
- func (s *Service) SetSyncCommittee(ctx context.Context, syncCommittee *chaindb.SyncCommittee) error
- func (s *Service) SetValidator(ctx context.Context, validator *chaindb.Validator) error
- func (s *Service) SetValidatorBalance(ctx context.Context, balance *chaindb.ValidatorBalance) error
- func (s *Service) SetValidatorBalances(ctx context.Context, balances []*chaindb.ValidatorBalance) error
- func (s *Service) SetValidatorEpochSummaries(ctx context.Context, summaries []*chaindb.ValidatorEpochSummary) error
- func (s *Service) SetValidatorEpochSummary(ctx context.Context, summary *chaindb.ValidatorEpochSummary) error
- func (s *Service) SetVoluntaryExit(ctx context.Context, voluntaryExit *chaindb.VoluntaryExit) error
- func (s *Service) Spec(ctx context.Context) (map[string]interface{}, error)
- func (s *Service) SyncCommittee(ctx context.Context, period uint64) (*chaindb.SyncCommittee, error)
- func (s *Service) Upgrade(ctx context.Context) (bool, error)
- func (s *Service) ValidatorBalancesByIndexAndEpoch(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) (map[phase0.ValidatorIndex]*chaindb.ValidatorBalance, error)
- func (s *Service) ValidatorBalancesByIndexAndEpochRange(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) (map[phase0.ValidatorIndex][]*chaindb.ValidatorBalance, error)
- func (s *Service) ValidatorBalancesByIndexAndEpochs(ctx context.Context, validatorIndices []phase0.ValidatorIndex, ...) (map[phase0.ValidatorIndex][]*chaindb.ValidatorBalance, error)
- func (s *Service) ValidatorSummaries(ctx context.Context, filter *chaindb.ValidatorSummaryFilter) ([]*chaindb.ValidatorEpochSummary, error)
- func (s *Service) ValidatorSummariesForEpoch(ctx context.Context, epoch phase0.Epoch) ([]*chaindb.ValidatorEpochSummary, error)
- func (s *Service) ValidatorSummaryForEpoch(ctx context.Context, index phase0.ValidatorIndex, epoch phase0.Epoch) (*chaindb.ValidatorEpochSummary, error)
- func (s *Service) Validators(ctx context.Context) ([]*chaindb.Validator, error)
- func (s *Service) ValidatorsByIndex(ctx context.Context, indices []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]*chaindb.Validator, error)
- func (s *Service) ValidatorsByPublicKey(ctx context.Context, pubKeys []phase0.BLSPubKey) (map[phase0.BLSPubKey]*chaindb.Validator, error)
- type Tx
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoTransaction is returned when an attempt to carry out a mutation to the database // is not inside a transaction. ErrNoTransaction = errors.New("no transaction for action") )
Functions ¶
This section is empty.
Types ¶
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithCACert ¶ added in v0.4.1
WithCACert sets the bytes of the certificate authority TLS certificate.
func WithClientCert ¶ added in v0.4.1
WithClientCert sets the bytes of the client TLS certificate.
func WithClientKey ¶ added in v0.4.1
WithClientKey sets the bytes of the client TLS key.
func WithConnectionURL ¶
WithConnectionURL sets the connection URL for this module. Deprecated. Use the individual Server/User/Port/... functions.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithPassword ¶ added in v0.4.1
WithPassword sets the password for this module.
func WithServer ¶ added in v0.4.1
WithServer sets the server for this module.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a chain database service.
func (*Service) AggregateValidatorBalancesByIndexAndEpoch ¶ added in v0.2.0
func (s *Service) AggregateValidatorBalancesByIndexAndEpoch( ctx context.Context, validatorIndices []phase0.ValidatorIndex, epoch phase0.Epoch, ) ( *chaindb.AggregateValidatorBalance, error, )
AggregateValidatorBalancesByIndexAndEpoch fetches the aggregate validator balances for the given validators and epoch.
func (*Service) AggregateValidatorBalancesByIndexAndEpochRange ¶ added in v0.2.0
func (s *Service) AggregateValidatorBalancesByIndexAndEpochRange( ctx context.Context, validatorIndices []phase0.ValidatorIndex, startEpoch phase0.Epoch, endEpoch phase0.Epoch, ) ( []*chaindb.AggregateValidatorBalance, error, )
AggregateValidatorBalancesByIndexAndEpochRange fetches the aggregate validator balances for the given validators and epoch range. Ranges are inclusive of start and exclusive of end i.e. a request with startEpoch 2 and endEpoch 4 will provide balances for epochs 2 and 3.
func (*Service) AggregateValidatorBalancesByIndexAndEpochs ¶ added in v0.2.0
func (s *Service) AggregateValidatorBalancesByIndexAndEpochs( ctx context.Context, validatorIndices []phase0.ValidatorIndex, epochs []phase0.Epoch, ) ( []*chaindb.AggregateValidatorBalance, error, )
AggregateValidatorBalancesByIndexAndEpochs fetches the validator balances for the given validators at the specified epochs.
func (*Service) AttestationsForBlock ¶ added in v0.1.5
func (s *Service) AttestationsForBlock(ctx context.Context, blockRoot phase0.Root) ([]*chaindb.Attestation, error)
AttestationsForBlock fetches all attestations made for the given block.
func (*Service) AttestationsForSlotRange ¶ added in v0.1.5
func (s *Service) AttestationsForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.Attestation, error)
AttestationsForSlotRange fetches all attestations made for the given slot range. Ranges are inclusive of start and exclusive of end i.e. a request with startSlot 2 and endSlot 4 will provide attestations for slots 2 and 3.
func (*Service) AttestationsInBlock ¶ added in v0.1.5
func (s *Service) AttestationsInBlock(ctx context.Context, blockRoot phase0.Root) ([]*chaindb.Attestation, error)
AttestationsInBlock fetches all attestations contained in the given block.
func (*Service) AttestationsInSlotRange ¶ added in v0.2.0
func (s *Service) AttestationsInSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.Attestation, error)
AttestationsInSlotRange fetches all attestations made in the given slot range. Ranges are inclusive of start and exclusive of end i.e. a request with startSlot 2 and endSlot 4 will provide attestations in slots 2 and 3.
func (*Service) AttesterDuties ¶ added in v0.1.5
func (s *Service) AttesterDuties(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot, validatorIndices []phase0.ValidatorIndex) ([]*chaindb.AttesterDuty, error)
AttesterDuties fetches the attester duties at the given slot range for the given validator indices.
func (*Service) AttesterSlashingsForSlotRange ¶ added in v0.3.0
func (s *Service) AttesterSlashingsForSlotRange(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]*chaindb.AttesterSlashing, error)
AttesterSlashingsForSlotRange fetches all attester slashings made for the given slot range. It will return slashings from blocks that are canonical or undefined, but not from non-canonical blocks.
func (*Service) AttesterSlashingsForValidator ¶ added in v0.3.0
func (s *Service) AttesterSlashingsForValidator(ctx context.Context, index phase0.ValidatorIndex) ([]*chaindb.AttesterSlashing, error)
AttesterSlashingsForValidator fetches all attester slashings made for the given validator. It will return slashings from blocks that are canonical or undefined, but not from non-canonical blocks.
func (*Service) BeaconCommitteeBySlotAndIndex ¶ added in v0.1.5
func (s *Service) BeaconCommitteeBySlotAndIndex(ctx context.Context, slot phase0.Slot, index phase0.CommitteeIndex) (*chaindb.BeaconCommittee, error)
BeaconCommitteeBySlotAndIndex fetches the beacon committee with the given slot and index.
func (*Service) BeginTx ¶
BeginTx begins a transaction on the database. The transaction can be rolled back by invoking the cancel function.
func (*Service) BlockByRoot ¶ added in v0.1.5
BlockByRoot fetches the block with the given root.
func (*Service) BlockSummaryForSlot ¶ added in v0.5.3
func (s *Service) BlockSummaryForSlot(ctx context.Context, slot phase0.Slot) (*chaindb.BlockSummary, error)
BlockSummaryForSlot obtains the summary of a block for a given slot.
func (*Service) BlocksByParentRoot ¶ added in v0.1.5
func (s *Service) BlocksByParentRoot(ctx context.Context, parentRoot phase0.Root) ([]*chaindb.Block, error)
BlocksByParentRoot fetches the blocks with the given root.
func (*Service) BlocksBySlot ¶ added in v0.1.5
BlocksBySlot fetches all blocks with the given slot.
func (*Service) BlocksForSlotRange ¶ added in v0.3.0
func (s *Service) BlocksForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]*chaindb.Block, error)
BlocksForSlotRange fetches all blocks with the given slot range. Ranges are inclusive of start and exclusive of end i.e. a request with startSlot 2 and endSlot 4 will provide blocks duties for slots 2 and 3.
func (*Service) CanonicalBlockPresenceForSlotRange ¶ added in v0.3.0
func (s *Service) CanonicalBlockPresenceForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot) ([]bool, error)
CanonicalBlockPresenceForSlotRange returns a boolean for each slot in the range for the presence of a canonical block. Ranges are inclusive of start and exclusive of end i.e. a request with startSlot 2 and endSlot 4 will provide presence duties for slots 2 and 3.
func (*Service) ChainSpecValue ¶ added in v0.2.0
ChainSpecValue fetches a chain specification value given its key.
func (*Service) DepositsByPublicKey ¶ added in v0.2.0
func (s *Service) DepositsByPublicKey(ctx context.Context, pubKeys []phase0.BLSPubKey) (map[phase0.BLSPubKey][]*chaindb.Deposit, error)
DepositsByPublicKey fetches deposits for a given set of validator public keys.
func (*Service) DepositsForSlotRange ¶ added in v0.3.0
func (s *Service) DepositsForSlotRange(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]*chaindb.Deposit, error)
DepositsForSlotRange fetches all deposits made in the given slot range. It will return deposits from blocks that are canonical or undefined, but not from non-canonical blocks.
func (*Service) ETH1DepositsByPublicKey ¶ added in v0.2.0
func (s *Service) ETH1DepositsByPublicKey(ctx context.Context, pubKeys []phase0.BLSPubKey) ([]*chaindb.ETH1Deposit, error)
ETH1DepositsByPublicKey fetches Ethereum 1 deposits for a given set of validator public keys.
func (*Service) EmptySlots ¶ added in v0.1.5
func (s *Service) EmptySlots(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]phase0.Slot, error)
EmptySlots fetches the slots in the given range without a block in the database.
func (*Service) ForkSchedule ¶ added in v0.4.0
ForkSchedule provides details of past and future changes in the chain's fork version.
func (*Service) GenesisTime ¶ added in v0.2.0
GenesisTime provides the genesis time of the chain.
func (*Service) IndeterminateAttestationSlots ¶ added in v0.2.0
func (s *Service) IndeterminateAttestationSlots(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]phase0.Slot, error)
IndeterminateAttestationSlots fetches the slots in the given range with attestations that do not have a canonical status.
func (*Service) IndeterminateBlocks ¶ added in v0.2.0
func (s *Service) IndeterminateBlocks(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]phase0.Root, error)
IndeterminateBlocks fetches the blocks in the given range that do not have a canonical status.
func (*Service) LatestBlocks ¶ added in v0.2.0
LatestBlocks fetches the blocks with the highest slot number for in the database.
func (*Service) LatestCanonicalBlock ¶ added in v0.3.0
LatestCanonicalBlock returns the slot of the latest canonical block known in the database.
func (*Service) ProposalCount ¶ added in v0.3.4
func (s *Service) ProposalCount(ctx context.Context, validatorIndices []phase0.ValidatorIndex, startSlot phase0.Slot, endSlot phase0.Slot) (uint64, error)
ProposalCount provides the number of proposals for the given validators. Ranges are inclusive of start and exclusive of end i.e. a request with startSlot 2 and endSlot 4 will provide blocks duties for slots 2 and 3.
func (*Service) ProposerDutiesForSlotRange ¶ added in v0.3.0
func (s *Service) ProposerDutiesForSlotRange(ctx context.Context, startSlot phase0.Slot, endSlot phase0.Slot, ) ( []*chaindb.ProposerDuty, error, )
ProposerDutiesForSlotRange fetches all proposer duties for a slot range.
func (*Service) ProposerDutiesForValidator ¶ added in v0.5.2
func (s *Service) ProposerDutiesForValidator(ctx context.Context, proposer phase0.ValidatorIndex) ([]*chaindb.ProposerDuty, error)
ProposerDutiesForValidator provides all proposer duties for the given validator index.
func (*Service) ProposerSlashingsForSlotRange ¶ added in v0.1.5
func (s *Service) ProposerSlashingsForSlotRange(ctx context.Context, minSlot phase0.Slot, maxSlot phase0.Slot) ([]*chaindb.ProposerSlashing, error)
ProposerSlashingsForSlotRange fetches all proposer slashings made for the given slot range. It will return slashings from blocks that are canonical or undefined, but not from non-canonical blocks.
func (*Service) ProposerSlashingsForValidator ¶ added in v0.3.0
func (s *Service) ProposerSlashingsForValidator(ctx context.Context, index phase0.ValidatorIndex) ([]*chaindb.ProposerSlashing, error)
ProposerSlashingsForValidator fetches all proposer slashings made for the given validator. It will return slashings from blocks that are canonical or undefined, but not from non-canonical blocks.
func (*Service) SetAttestation ¶
SetAttestation sets an attestation.
func (*Service) SetAttesterSlashing ¶
func (s *Service) SetAttesterSlashing(ctx context.Context, attesterSlashing *chaindb.AttesterSlashing) error
SetAttesterSlashing sets an attester slashing.
func (*Service) SetBeaconCommittee ¶
func (s *Service) SetBeaconCommittee(ctx context.Context, beaconCommittee *chaindb.BeaconCommittee) error
SetBeaconCommittee sets a beacon committee.
func (*Service) SetBlockSummary ¶ added in v0.3.0
SetBlockSummary sets a block summary.
func (*Service) SetChainSpecValue ¶ added in v0.2.0
SetChainSpecValue sets the value of the provided key.
func (*Service) SetDeposit ¶ added in v0.2.0
SetDeposit sets a deposit.
func (*Service) SetETH1Deposit ¶ added in v0.2.0
SetETH1Deposit sets an Ethereum 1 deposit.
func (*Service) SetEpochSummary ¶ added in v0.3.0
SetEpochSummary sets an epoch summary.
func (*Service) SetForkSchedule ¶ added in v0.4.0
SetForkSchedule sets the fork schedule. This carries out a complete rewrite of the table.
func (*Service) SetGenesis ¶ added in v0.2.0
SetGenesis sets the genesis information.
func (*Service) SetMetadata ¶
SetMetadata sets a metadata key to a JSON value.
func (*Service) SetProposerDuty ¶
SetProposerDuty sets a proposer duty.
func (*Service) SetProposerSlashing ¶
func (s *Service) SetProposerSlashing(ctx context.Context, proposerSlashing *chaindb.ProposerSlashing) error
SetProposerSlashing sets a proposer slashing.
func (*Service) SetSyncAggregate ¶ added in v0.4.0
SetSyncAggregate sets the sync aggregate.
func (*Service) SetSyncCommittee ¶ added in v0.4.0
SetSyncCommittee sets a sync committee.
func (*Service) SetValidator ¶
SetValidator sets a validator.
func (*Service) SetValidatorBalance ¶
SetValidatorBalance sets a validator's balance.
func (*Service) SetValidatorBalances ¶ added in v0.5.0
func (s *Service) SetValidatorBalances(ctx context.Context, balances []*chaindb.ValidatorBalance) error
SetValidatorBalances sets multiple validator balances.
func (*Service) SetValidatorEpochSummaries ¶ added in v0.5.0
func (s *Service) SetValidatorEpochSummaries(ctx context.Context, summaries []*chaindb.ValidatorEpochSummary) error
SetValidatorEpochSummaries sets multiple validator epoch summaries.
func (*Service) SetValidatorEpochSummary ¶ added in v0.3.0
func (s *Service) SetValidatorEpochSummary(ctx context.Context, summary *chaindb.ValidatorEpochSummary) error
SetValidatorEpochSummary sets a validator epoch summary.
func (*Service) SetVoluntaryExit ¶
SetVoluntaryExit sets a voluntary exit.
func (*Service) SyncCommittee ¶ added in v0.4.0
SyncCommittee provides a sync committee for the given sync committee period.
func (*Service) Upgrade ¶ added in v0.2.0
Upgrade upgrades the database. Returns true if the upgrade requires blocks to be refetched.
func (*Service) ValidatorBalancesByIndexAndEpoch ¶ added in v0.1.5
func (s *Service) ValidatorBalancesByIndexAndEpoch( ctx context.Context, validatorIndices []phase0.ValidatorIndex, epoch phase0.Epoch, ) ( map[phase0.ValidatorIndex]*chaindb.ValidatorBalance, error, )
ValidatorBalancesByIndexAndEpoch fetches the validator balances for the given validators and epoch.
func (*Service) ValidatorBalancesByIndexAndEpochRange ¶ added in v0.1.5
func (s *Service) ValidatorBalancesByIndexAndEpochRange( ctx context.Context, validatorIndices []phase0.ValidatorIndex, startEpoch phase0.Epoch, endEpoch phase0.Epoch, ) ( map[phase0.ValidatorIndex][]*chaindb.ValidatorBalance, error, )
ValidatorBalancesByIndexAndEpochRange fetches the validator balances for the given validators and epoch range. Ranges are inclusive of start and exclusive of end i.e. a request with startEpoch 2 and endEpoch 4 will provide balances for epochs 2 and 3.
func (*Service) ValidatorBalancesByIndexAndEpochs ¶ added in v0.1.5
func (s *Service) ValidatorBalancesByIndexAndEpochs( ctx context.Context, validatorIndices []phase0.ValidatorIndex, epochs []phase0.Epoch, ) ( map[phase0.ValidatorIndex][]*chaindb.ValidatorBalance, error, )
ValidatorBalancesByIndexAndEpochs fetches the validator balances for the given validators at the specified epochs.
func (*Service) ValidatorSummaries ¶ added in v0.5.3
func (s *Service) ValidatorSummaries(ctx context.Context, filter *chaindb.ValidatorSummaryFilter) ([]*chaindb.ValidatorEpochSummary, error)
ValidatorSummaries provides summaries according to the filter.
func (*Service) ValidatorSummariesForEpoch ¶ added in v0.5.2
func (s *Service) ValidatorSummariesForEpoch(ctx context.Context, epoch phase0.Epoch) ([]*chaindb.ValidatorEpochSummary, error)
ValidatorSummariesForEpoch obtains all summaries for a given epoch.
func (*Service) ValidatorSummaryForEpoch ¶ added in v0.5.2
func (s *Service) ValidatorSummaryForEpoch(ctx context.Context, index phase0.ValidatorIndex, epoch phase0.Epoch, ) ( *chaindb.ValidatorEpochSummary, error, )
ValidatorSummaryForEpoch obtains the summary of a validator for a given epoch.
func (*Service) Validators ¶ added in v0.1.4
Validators fetches all validators.
func (*Service) ValidatorsByIndex ¶ added in v0.1.5
func (s *Service) ValidatorsByIndex(ctx context.Context, indices []phase0.ValidatorIndex) (map[phase0.ValidatorIndex]*chaindb.Validator, error)
ValidatorsByIndex fetches all validators matching the given indices.
func (*Service) ValidatorsByPublicKey ¶ added in v0.1.5
func (s *Service) ValidatorsByPublicKey(ctx context.Context, pubKeys []phase0.BLSPubKey) (map[phase0.BLSPubKey]*chaindb.Validator, error)
ValidatorsByPublicKey fetches all validators matching the given public keys. This is a common starting point for external entities to query specific validators, as they should always have the public key at a minimum, hence the return map keyed by public key.
Source Files ¶
- aggregatevalidatorbalances.go
- attestations.go
- attesterslashing.go
- beaconcommittees.go
- blocks.go
- blocksummaries.go
- chainspec.go
- deposits.go
- epochsummaries.go
- eth1deposits.go
- forkschedule.go
- genesis.go
- metadata.go
- parameters.go
- proposerduties.go
- proposerslashings.go
- service.go
- spec.go
- syncaggregate.go
- synccommittees.go
- tx.go
- upgrader.go
- validatorepochsummaries.go
- validators.go
- voluntaryexits.go