Documentation ¶
Overview ¶
Package client represents the functionality to act as a validator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasProposedForEpoch ¶ added in v0.3.2
func HasProposedForEpoch(history *slashpb.ProposalHistory, epoch uint64) bool
HasProposedForEpoch returns whether a validators proposal history has been marked for the entered epoch. If the request is more in the future than what the history contains, it will return false. If the request is from the past, and likely previously pruned it will return false.
func SetProposedForEpoch ¶ added in v0.3.2
func SetProposedForEpoch(history *slashpb.ProposalHistory, epoch uint64) *slashpb.ProposalHistory
SetProposedForEpoch updates the proposal history to mark the indicated epoch in the bitlist and updates the last epoch written if needed. Returns the modified proposal history.
Types ¶
type Config ¶
type Config struct { Endpoint string DataDir string CertFlag string GraffitiFlag string KeyManager keymanager.KeyManager LogValidatorBalances bool EmitAccountMetrics bool GrpcMaxCallRecvMsgSizeFlag int GrpcRetriesFlag uint }
Config for the validator service.
type Validator ¶
type Validator interface { Done() WaitForChainStart(ctx context.Context) error WaitForActivation(ctx context.Context) error WaitForSync(ctx context.Context) error CanonicalHeadSlot(ctx context.Context) (uint64, error) NextSlot() <-chan uint64 SlotDeadline(slot uint64) time.Time LogValidatorGainsAndLosses(ctx context.Context, slot uint64) error UpdateDuties(ctx context.Context, slot uint64) error RolesAt(ctx context.Context, slot uint64) (map[[48]byte][]pb.ValidatorRole, error) // validator pubKey -> roles SubmitAttestation(ctx context.Context, slot uint64, pubKey [48]byte) ProposeBlock(ctx context.Context, slot uint64, pubKey [48]byte) SubmitAggregateAndProof(ctx context.Context, slot uint64, pubKey [48]byte) LogAttestationsSubmitted() UpdateDomainDataCaches(ctx context.Context, slot uint64) }
Validator interface defines the primary methods of a validator client.
type ValidatorService ¶
type ValidatorService struct {
// contains filtered or unexported fields
}
ValidatorService represents a service to manage the validator client routine.
func NewValidatorService ¶
func NewValidatorService(ctx context.Context, cfg *Config) (*ValidatorService, error)
NewValidatorService creates a new validator service for the service registry.
func (*ValidatorService) Start ¶
func (v *ValidatorService) Start()
Start the validator service. Launches the main go routine for the validator client.
func (*ValidatorService) Status ¶
func (v *ValidatorService) Status() error
Status ...
WIP - not done.