Documentation
¶
Index ¶
- Variables
- func NewBeaconClient(l log.Logger, endpoint string, config BeaconConfig) (*beaconClient, error)
- type AllValidatorsResponse
- type BeaconConfig
- type BeaconMetrics
- type BeaconNode
- type Data
- type GenesisResponse
- type GetForkScheduleResponse
- type GetRandaoResponse
- type GetWithdrawalsResponse
- type HeadEvent
- type Header
- type HeaderRootObject
- type Message
- type MultiBeaconClient
- func (b *MultiBeaconClient) Endpoint() string
- func (b *MultiBeaconClient) Genesis() (genesisInfo structs.GenesisInfo, err error)
- func (b *MultiBeaconClient) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
- func (b *MultiBeaconClient) GetProposerDuties(epoch structs.Epoch) (*RegisteredProposersResponse, error)
- func (b *MultiBeaconClient) GetWithdrawals(slot structs.Slot) (withdrawalsResp *GetWithdrawalsResponse, err error)
- func (b *MultiBeaconClient) KnownValidators(headSlot structs.Slot) (AllValidatorsResponse, error)
- func (b *MultiBeaconClient) PublishBlock(ctx context.Context, block structs.SignedBeaconBlock) (err error)
- func (b *MultiBeaconClient) Randao(slot structs.Slot) (randao string, err error)
- func (b *MultiBeaconClient) SubscribeToHeadEvents(ctx context.Context, slotC chan HeadEvent)
- func (b *MultiBeaconClient) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent)
- func (b *MultiBeaconClient) SyncStatus() (*SyncStatusPayloadData, error)
- type PayloadAttributes
- type PayloadAttributesEvent
- type PayloadAttributesEventData
- type RegisteredProposersResponse
- type RegisteredProposersResponseData
- type SyncStatusPayload
- type SyncStatusPayloadData
- type ValidatorResponseEntry
- type ValidatorResponseValidatorData
- Bugs
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHTTPErrorResponse = errors.New("got an HTTP error response") ErrBlockPublish202 = errors.New("the block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database") )
Functions ¶
func NewBeaconClient ¶
func NewBeaconClient(l log.Logger, endpoint string, config BeaconConfig) (*beaconClient, error)
Types ¶
type AllValidatorsResponse ¶
type AllValidatorsResponse struct {
Data []ValidatorResponseEntry
}
AllValidatorsResponse is the response for querying active validators
type BeaconConfig ¶ added in v0.4.11
type BeaconMetrics ¶
type BeaconMetrics struct {
Timing *prometheus.HistogramVec
}
type BeaconNode ¶
type BeaconNode interface {
SubscribeToHeadEvents(ctx context.Context, slotC chan HeadEvent)
GetProposerDuties(structs.Epoch) (*RegisteredProposersResponse, error)
SyncStatus() (*SyncStatusPayloadData, error)
KnownValidators(structs.Slot) (AllValidatorsResponse, error)
Genesis() (structs.GenesisInfo, error)
GetForkSchedule() (*GetForkScheduleResponse, error)
PublishBlock(context.Context, structs.SignedBeaconBlock) error
PublishV2Block(context.Context, structs.SignedBeaconBlock) error
Randao(structs.Slot) (string, error)
Endpoint() string
GetWithdrawals(structs.Slot) (*GetWithdrawalsResponse, error)
SubscribeToPayloadAttributesEvents(payloadAttrC chan PayloadAttributesEvent)
}
type GenesisResponse ¶
type GenesisResponse struct {
Data structs.GenesisInfo
}
type GetForkScheduleResponse ¶
type GetRandaoResponse ¶
type GetRandaoResponse struct {
Data struct {
Randao string `json:"randao"`
}
}
GetRandaoResponse is the response for querying randao from beacon
type GetWithdrawalsResponse ¶
type GetWithdrawalsResponse struct {
Data struct {
Withdrawals structs.Withdrawals `json:"withdrawals"`
}
}
type HeadEvent ¶
type HeadEvent struct {
Slot uint64 `json:"slot,string"`
}
HeadEvent is emitted when subscribing to head events
type HeaderRootObject ¶ added in v0.4.9
type Message ¶ added in v0.4.9
type Message struct {
Slot uint64 `json:"slot,string"`
ProposerIndex string `json:"proposer_index"`
ParentRoot string `json:"parent_root"`
StateRoot string `json:"state_root"`
BodyRoot string `json:"body_root"`
}
Header is the block header from the beacon chain
type MultiBeaconClient ¶
type MultiBeaconClient struct {
Log log.Logger
Clients []BeaconNode
PublishV2Clients []BeaconNode
// contains filtered or unexported fields
}
func NewMultiBeaconClient ¶
func NewMultiBeaconClient(l log.Logger, clients []BeaconNode) *MultiBeaconClient
func (*MultiBeaconClient) Endpoint ¶
func (b *MultiBeaconClient) Endpoint() string
func (*MultiBeaconClient) Genesis ¶
func (b *MultiBeaconClient) Genesis() (genesisInfo structs.GenesisInfo, err error)
func (*MultiBeaconClient) GetForkSchedule ¶
func (b *MultiBeaconClient) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
func (*MultiBeaconClient) GetProposerDuties ¶
func (b *MultiBeaconClient) GetProposerDuties(epoch structs.Epoch) (*RegisteredProposersResponse, error)
func (*MultiBeaconClient) GetWithdrawals ¶
func (b *MultiBeaconClient) GetWithdrawals(slot structs.Slot) (withdrawalsResp *GetWithdrawalsResponse, err error)
func (*MultiBeaconClient) KnownValidators ¶
func (b *MultiBeaconClient) KnownValidators(headSlot structs.Slot) (AllValidatorsResponse, error)
func (*MultiBeaconClient) PublishBlock ¶
func (b *MultiBeaconClient) PublishBlock(ctx context.Context, block structs.SignedBeaconBlock) (err error)
func (*MultiBeaconClient) Randao ¶
func (b *MultiBeaconClient) Randao(slot structs.Slot) (randao string, err error)
func (*MultiBeaconClient) SubscribeToHeadEvents ¶
func (b *MultiBeaconClient) SubscribeToHeadEvents(ctx context.Context, slotC chan HeadEvent)
func (*MultiBeaconClient) SubscribeToPayloadAttributesEvents ¶ added in v0.4.14
func (b *MultiBeaconClient) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent)
func (*MultiBeaconClient) SyncStatus ¶
func (b *MultiBeaconClient) SyncStatus() (*SyncStatusPayloadData, error)
type PayloadAttributes ¶ added in v0.4.14
type PayloadAttributes struct {
Timestamp uint64 `json:"timestamp,string"`
PrevRandao string `json:"prev_randao"`
SuggestedFeeRecipient string `json:"suggested_fee_recipient"`
Withdrawals []*structs.Withdrawal `json:"withdrawals"`
}
type PayloadAttributesEvent ¶ added in v0.4.14
type PayloadAttributesEvent struct {
Version string `json:"version"`
Data PayloadAttributesEventData `json:"data"`
}
type PayloadAttributesEventData ¶ added in v0.4.14
type PayloadAttributesEventData struct {
ProposerIndex uint64 `json:"proposer_index,string"`
ProposalSlot uint64 `json:"proposal_slot,string"`
ParentBlockNumber uint64 `json:"parent_block_number,string"`
ParentBlockRoot string `json:"parent_block_root"`
ParentBlockHash string `json:"parent_block_hash"`
PayloadAttributes PayloadAttributes `json:"payload_attributes"`
}
type RegisteredProposersResponse ¶
type RegisteredProposersResponse struct {
Data []RegisteredProposersResponseData
}
RegisteredProposersResponse is the response for querying proposer duties
type SyncStatusPayload ¶
type SyncStatusPayload struct {
Data SyncStatusPayloadData
}
SyncStatusPayload is the response payload for /eth/v1/node/syncing
type SyncStatusPayloadData ¶
type ValidatorResponseEntry ¶
type ValidatorResponseEntry struct {
Index uint64 `json:"index,string"` // Index of validator in validator registry.
Balance string `json:"balance"` // Current validator balance in gwei.
Status string `json:"status"`
Validator ValidatorResponseValidatorData `json:"validator"`
}
type ValidatorResponseValidatorData ¶
type ValidatorResponseValidatorData struct {
Pubkey string `json:"pubkey"`
}
Notes ¶
Bugs ¶
do something with unsupported
Click to show internal directories.
Click to hide internal directories.