Documentation
¶
Index ¶
- Constants
- func GetRequest(endpoint string, target interface{}) error
- func PostRequest(endpoint string, target interface{}, data interface{}) error
- func Start(opts ...Option) error
- type AttesterDutiesResponse
- type AttesterDuty
- type BeaconBlockHeader
- type Option
- type ProposerDutiesResponse
- type ProposerDuty
- type SignedBeaconBlockHeader
- type SignedBeaconBlockHeaderContainer
- type SignedBeaconBlockResponse
- type SyncCommitteeDutiesResponse
- type SyncCommitteeDuty
- type ValidatorDuties
- func (d *ValidatorDuties) DisplayDuties()
- func (d *ValidatorDuties) ProcessAttesterDuties(epoch uint64) (uint64, error)
- func (d *ValidatorDuties) ProcessProposerDuties(epoch uint64) ([]uint64, error)
- func (d *ValidatorDuties) ProcessSyncCommitteeDuties(epoch uint64) (bool, error)
- func (d *ValidatorDuties) QueryAttesterDuties(epoch uint64) (*AttesterDutiesResponse, error)
- func (d *ValidatorDuties) QueryBeaconHeadBlock() (*SignedBeaconBlockResponse, error)
- func (d *ValidatorDuties) QueryProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
- func (d *ValidatorDuties) QuerySyncCommitteeDuties(epoch uint64) (*SyncCommitteeDutiesResponse, error)
- type ValidatorDutyEpoch
Constants ¶
View Source
const ( // Number of slots per epoch SlotsPerEpoch = 32 // Number of seconds per beacon slot SecondsPerSlot = 12 // Timestamp of the beacon chain genesis BeaconChainGenesis = 1606824023 )
Variables ¶
This section is empty.
Functions ¶
func GetRequest ¶
Performs a GET request and unmarshals the JSON with the given target type
func PostRequest ¶
Performs a POST request and unmarshals the JSON wwith the given target type
Types ¶
type AttesterDutiesResponse ¶
type AttesterDutiesResponse struct {
DependentRoot string `json:"dependent_root"`
Data []*AttesterDuty `json:"data"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type AttesterDuty ¶
type AttesterDuty struct {
Pubkey string `json:"pubkey"`
CommitteeIndex string `json:"committee_index"`
CommitteeLength string `json:"committee_length"`
CommitteesAtSlot string `json:"committees_at_slot"`
ValidatorCommiteeIndex string `json:"validator_committee_index"`
ValidatorIndex uint64 `json:"validator_index,string"`
Slot uint64 `json:"slot,string"`
}
type BeaconBlockHeader ¶
type Option ¶
type Option func(d *ValidatorDuties) error
Option type that will operate on the validator duties and modify its state
func WithBeaconNodeEndpoint ¶
func WithTimezone ¶
func WithValidator ¶
type ProposerDutiesResponse ¶
type ProposerDutiesResponse struct {
DependentRoot string `json:"dependent_root"`
Data []*ProposerDuty `json:"data"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type ProposerDuty ¶
type SignedBeaconBlockHeader ¶
type SignedBeaconBlockHeader struct {
Signature string `json:"signature"`
Message BeaconBlockHeader `json:"message"`
}
type SignedBeaconBlockHeaderContainer ¶
type SignedBeaconBlockHeaderContainer struct {
Root string `json:"root"`
Header SignedBeaconBlockHeader `json:"header"`
Canonical bool `json:"canonical"`
}
type SignedBeaconBlockResponse ¶
type SignedBeaconBlockResponse struct {
Data SignedBeaconBlockHeaderContainer `json:"data"`
ExecutionOptimistic bool `json:"execution_optimistic"`
Finalized bool `json:"finalized"`
}
type SyncCommitteeDutiesResponse ¶
type SyncCommitteeDutiesResponse struct {
DependentRoot string `json:"dependent_root"`
Data []*SyncCommitteeDuty `json:"data"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type SyncCommitteeDuty ¶
type ValidatorDuties ¶
type ValidatorDuties struct {
Timezone *time.Location
CurrEpochDuties *ValidatorDutyEpoch
NextEpochDuties *ValidatorDutyEpoch
BeaconNodeEndpoint string
Validator uint64
}
func New ¶
func New(opts ...Option) (*ValidatorDuties, error)
Create a new instance of validator duties
func (*ValidatorDuties) DisplayDuties ¶
func (d *ValidatorDuties) DisplayDuties()
func (*ValidatorDuties) ProcessAttesterDuties ¶
func (d *ValidatorDuties) ProcessAttesterDuties(epoch uint64) (uint64, error)
Processes an attester duty response
func (*ValidatorDuties) ProcessProposerDuties ¶
func (d *ValidatorDuties) ProcessProposerDuties(epoch uint64) ([]uint64, error)
Processes a proposer duty response
func (*ValidatorDuties) ProcessSyncCommitteeDuties ¶
func (d *ValidatorDuties) ProcessSyncCommitteeDuties(epoch uint64) (bool, error)
Processes sync committee duty response
func (*ValidatorDuties) QueryAttesterDuties ¶
func (d *ValidatorDuties) QueryAttesterDuties(epoch uint64) (*AttesterDutiesResponse, error)
Queries the duties of the attester for a given epoch
func (*ValidatorDuties) QueryBeaconHeadBlock ¶
func (d *ValidatorDuties) QueryBeaconHeadBlock() (*SignedBeaconBlockResponse, error)
Queries the head block of the beacon chain
func (*ValidatorDuties) QueryProposerDuties ¶
func (d *ValidatorDuties) QueryProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
Queries the duties of the proposer for a given epoch
func (*ValidatorDuties) QuerySyncCommitteeDuties ¶
func (d *ValidatorDuties) QuerySyncCommitteeDuties( epoch uint64, ) (*SyncCommitteeDutiesResponse, error)
Queries the sync committee duties for a given epoch
Click to show internal directories.
Click to hide internal directories.