Documentation ¶
Overview ¶
Package beaconclient provides a beacon-node client
Index ¶
- Variables
- type BroadcastMode
- type GetBlockResponse
- type GetForkScheduleResponse
- type GetGenesisResponse
- type GetGenesisResponseData
- type GetHeaderResponse
- type GetHeaderResponseMessage
- type GetRandaoResponse
- type GetSpecResponse
- type GetStateValidatorsResponse
- type GetWithdrawalsResponse
- type HeadEventData
- type IBeaconInstance
- type IMultiBeaconClient
- type MockBeaconInstance
- func (c *MockBeaconInstance) AddValidator(entry ValidatorResponseEntry)
- func (c *MockBeaconInstance) CurrentSlot() (uint64, error)
- func (c *MockBeaconInstance) GetBlock(blockID string) (block *GetBlockResponse, err error)
- func (c *MockBeaconInstance) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
- func (c *MockBeaconInstance) GetGenesis() (*GetGenesisResponse, error)
- func (c *MockBeaconInstance) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
- func (c *MockBeaconInstance) GetRandao(slot uint64) (spec *GetRandaoResponse, err error)
- func (c *MockBeaconInstance) GetSpec() (spec *GetSpecResponse, err error)
- func (c *MockBeaconInstance) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
- func (c *MockBeaconInstance) GetURI() string
- func (c *MockBeaconInstance) GetWithdrawals(slot uint64) (spec *GetWithdrawalsResponse, err error)
- func (c *MockBeaconInstance) IsValidator(pubkey common.PubkeyHex) bool
- func (c *MockBeaconInstance) NumValidators() uint64
- func (c *MockBeaconInstance) PublishBlock(block *common.VersionedSignedBlockRequest, broadcaseMode BroadcastMode) (code int, err error)
- func (c *MockBeaconInstance) SetValidators(validatorSet map[common.PubkeyHex]ValidatorResponseEntry)
- func (c *MockBeaconInstance) SubscribeToHeadEvents(slotC chan HeadEventData)
- func (c *MockBeaconInstance) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent)
- func (c *MockBeaconInstance) SyncStatus() (*SyncStatusPayloadData, error)
- type MockMultiBeaconClient
- func (*MockMultiBeaconClient) BestSyncStatus() (*SyncStatusPayloadData, error)
- func (*MockMultiBeaconClient) GetBlock(blockID string) (block *GetBlockResponse, err error)
- func (*MockMultiBeaconClient) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
- func (*MockMultiBeaconClient) GetGenesis() (*GetGenesisResponse, error)
- func (*MockMultiBeaconClient) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
- func (*MockMultiBeaconClient) GetRandao(slot uint64) (spec *GetRandaoResponse, err error)
- func (*MockMultiBeaconClient) GetSpec() (spec *GetSpecResponse, err error)
- func (*MockMultiBeaconClient) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
- func (*MockMultiBeaconClient) GetWithdrawals(slot uint64) (spec *GetWithdrawalsResponse, err error)
- func (*MockMultiBeaconClient) PublishBlock(block *common.VersionedSignedBlockRequest) (code int, err error)
- func (*MockMultiBeaconClient) SubscribeToHeadEvents(slotC chan HeadEventData)
- func (*MockMultiBeaconClient) SubscribeToPayloadAttributesEvents(payloadAttrC chan PayloadAttributesEvent)
- type MultiBeaconClient
- func (c *MultiBeaconClient) BestSyncStatus() (*SyncStatusPayloadData, error)
- func (c *MultiBeaconClient) GetBlock(blockID string) (block *GetBlockResponse, err error)
- func (c *MultiBeaconClient) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
- func (c *MultiBeaconClient) GetGenesis() (genesisInfo *GetGenesisResponse, err error)
- func (c *MultiBeaconClient) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
- func (c *MultiBeaconClient) GetRandao(slot uint64) (randaoResp *GetRandaoResponse, err error)
- func (c *MultiBeaconClient) GetSpec() (spec *GetSpecResponse, err error)
- func (c *MultiBeaconClient) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
- func (c *MultiBeaconClient) GetWithdrawals(slot uint64) (withdrawalsResp *GetWithdrawalsResponse, err error)
- func (c *MultiBeaconClient) PublishBlock(block *common.VersionedSignedBlockRequest) (code int, err error)
- func (c *MultiBeaconClient) SubscribeToHeadEvents(slotC chan HeadEventData)
- func (c *MultiBeaconClient) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent)
- type PayloadAttributes
- type PayloadAttributesEvent
- type PayloadAttributesEventData
- type ProdBeaconInstance
- func (c *ProdBeaconInstance) CurrentSlot() (uint64, error)
- func (c *ProdBeaconInstance) GetBlock(blockID string) (block *GetBlockResponse, err error)
- func (c *ProdBeaconInstance) GetBlockForSlot(slot uint64) (*GetBlockResponse, error)
- func (c *ProdBeaconInstance) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
- func (c *ProdBeaconInstance) GetGenesis() (*GetGenesisResponse, error)
- func (c *ProdBeaconInstance) GetHeader() (*GetHeaderResponse, error)
- func (c *ProdBeaconInstance) GetHeaderForSlot(slot uint64) (*GetHeaderResponse, error)
- func (c *ProdBeaconInstance) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
- func (c *ProdBeaconInstance) GetRandao(slot uint64) (randaoResp *GetRandaoResponse, err error)
- func (c *ProdBeaconInstance) GetSpec() (spec *GetSpecResponse, err error)
- func (c *ProdBeaconInstance) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
- func (c *ProdBeaconInstance) GetURI() string
- func (c *ProdBeaconInstance) GetWithdrawals(slot uint64) (withdrawalsResp *GetWithdrawalsResponse, err error)
- func (c *ProdBeaconInstance) PublishBlock(block *common.VersionedSignedBlockRequest, broadcastMode BroadcastMode) (code int, err error)
- func (c *ProdBeaconInstance) SubscribeToHeadEvents(slotC chan HeadEventData)
- func (c *ProdBeaconInstance) SubscribeToPayloadAttributesEvents(payloadAttributesC chan PayloadAttributesEvent)
- func (c *ProdBeaconInstance) SyncStatus() (*SyncStatusPayloadData, error)
- type ProposerDutiesResponse
- type ProposerDutiesResponseData
- type SyncStatusPayload
- type SyncStatusPayloadData
- type ValidatorResponseEntry
- type ValidatorResponseValidatorData
Constants ¶
This section is empty.
Variables ¶
var ( ErrBeaconNodeSyncing = errors.New("beacon node is syncing or unavailable") ErrWithdrawalsBeforeCapella = errors.New("withdrawals are not supported before capella") ErrBeaconBlock202 = errors.New("beacon block failed validation but was still broadcast (202)") )
var ( ErrHTTPErrorResponse = errors.New("got an HTTP error response") ErrInvalidRequestPayload = errors.New("invalid request payload") StateIDHead = "head" StateIDGenesis = "genesis" StateIDFinalized = "finalized" StateIDJustified = "justified" )
Functions ¶
This section is empty.
Types ¶
type BroadcastMode ¶ added in v0.27.1
type BroadcastMode int
const ( Gossip BroadcastMode = iota // lightweight gossip checks only Consensus // full consensus checks, including validation of all signatures and blocks fields ConsensusAndEquivocation // the same as `consensus`, with an extra equivocation check )
func (BroadcastMode) String ¶ added in v0.27.1
func (b BroadcastMode) String() string
type GetBlockResponse ¶
type GetBlockResponse struct { Data struct { Message struct { Slot uint64 `json:"slot,string"` Body struct { ExecutionPayload capella.ExecutionPayload `json:"execution_payload"` } } } }
type GetForkScheduleResponse ¶ added in v0.20.0
type GetGenesisResponse ¶ added in v0.14.0
type GetGenesisResponse struct {
Data GetGenesisResponseData `json:"data"`
}
type GetGenesisResponseData ¶ added in v0.20.0
type GetHeaderResponse ¶
type GetHeaderResponse struct { Data struct { Root string `json:"root"` Header struct { Message *GetHeaderResponseMessage } } }
type GetRandaoResponse ¶ added in v0.14.0
type GetRandaoResponse struct { Data struct { Randao string `json:"randao"` } }
type GetSpecResponse ¶ added in v0.14.0
type GetSpecResponse struct { SecondsPerSlot uint64 `json:"SECONDS_PER_SLOT,string"` //nolint:tagliatelle DepositContractAddress string `json:"DEPOSIT_CONTRACT_ADDRESS"` //nolint:tagliatelle DepositNetworkID string `json:"DEPOSIT_NETWORK_ID"` //nolint:tagliatelle DomainAggregateAndProof string `json:"DOMAIN_AGGREGATE_AND_PROOF"` //nolint:tagliatelle InactivityPenaltyQuotient string `json:"INACTIVITY_PENALTY_QUOTIENT"` //nolint:tagliatelle InactivityPenaltyQuotientAltair string `json:"INACTIVITY_PENALTY_QUOTIENT_ALTAIR"` //nolint:tagliatelle }
type GetStateValidatorsResponse ¶ added in v0.20.0
type GetStateValidatorsResponse struct { ExecutionOptimistic bool `json:"execution_optimistic"` Finalized bool `json:"finalized"` Data []ValidatorResponseEntry }
type GetWithdrawalsResponse ¶ added in v0.20.0
type GetWithdrawalsResponse struct { Data struct { Withdrawals []*capella.Withdrawal `json:"withdrawals"` } }
type HeadEventData ¶
type HeadEventData struct { Slot uint64 `json:"slot,string"` Block string `json:"block"` State string `json:"state"` }
HeadEventData represents the data of a head event {"slot":"827256","block":"0x56b683afa68170c775f3c9debc18a6a72caea9055584d037333a6fe43c8ceb83","state":"0x419e2965320d69c4213782dae73941de802a4f436408fddd6f68b671b3ff4e55","epoch_transition":false,"execution_optimistic":false,"previous_duty_dependent_root":"0x5b81a526839b7fb67c3896f1125451755088fb578ad27c2690b3209f3d7c6b54","current_duty_dependent_root":"0x5f3232c0d5741e27e13754e1d88285c603b07dd6164b35ca57e94344a9e42942"}
type IBeaconInstance ¶ added in v0.5.1
type IBeaconInstance interface { SyncStatus() (*SyncStatusPayloadData, error) CurrentSlot() (uint64, error) SubscribeToHeadEvents(slotC chan HeadEventData) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error) GetURI() string PublishBlock(block *common.VersionedSignedBlockRequest, broadcastMode BroadcastMode) (code int, err error) GetGenesis() (*GetGenesisResponse, error) GetSpec() (spec *GetSpecResponse, err error) GetForkSchedule() (spec *GetForkScheduleResponse, err error) GetBlock(blockID string) (*GetBlockResponse, error) GetRandao(slot uint64) (spec *GetRandaoResponse, err error) GetWithdrawals(slot uint64) (spec *GetWithdrawalsResponse, err error) }
IBeaconInstance is the interface for a single beacon client instance
type IMultiBeaconClient ¶ added in v0.5.1
type IMultiBeaconClient interface { BestSyncStatus() (*SyncStatusPayloadData, error) SubscribeToHeadEvents(slotC chan HeadEventData) // SubscribeToPayloadAttributesEvents subscribes to payload attributes events to validate fields such as prevrandao and withdrawals SubscribeToPayloadAttributesEvents(payloadAttrC chan PayloadAttributesEvent) // GetStateValidators returns all active and pending validators from the beacon node GetStateValidators(stateID string) (*GetStateValidatorsResponse, error) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error) PublishBlock(block *common.VersionedSignedBlockRequest) (code int, err error) GetGenesis() (*GetGenesisResponse, error) GetSpec() (spec *GetSpecResponse, err error) GetForkSchedule() (spec *GetForkScheduleResponse, err error) GetBlock(blockID string) (block *GetBlockResponse, err error) GetRandao(slot uint64) (spec *GetRandaoResponse, err error) GetWithdrawals(slot uint64) (spec *GetWithdrawalsResponse, err error) }
IMultiBeaconClient is the interface for the MultiBeaconClient, which can manage several beacon client instances under the hood
type MockBeaconInstance ¶ added in v0.5.1
type MockBeaconInstance struct { MockSyncStatus *SyncStatusPayloadData MockSyncStatusErr error MockProposerDuties *ProposerDutiesResponse MockProposerDutiesErr error MockFetchValidatorsErr error ResponseDelay time.Duration // contains filtered or unexported fields }
func NewMockBeaconInstance ¶ added in v0.5.1
func NewMockBeaconInstance() *MockBeaconInstance
func (*MockBeaconInstance) AddValidator ¶ added in v0.5.1
func (c *MockBeaconInstance) AddValidator(entry ValidatorResponseEntry)
func (*MockBeaconInstance) CurrentSlot ¶ added in v0.5.1
func (c *MockBeaconInstance) CurrentSlot() (uint64, error)
func (*MockBeaconInstance) GetBlock ¶ added in v0.14.0
func (c *MockBeaconInstance) GetBlock(blockID string) (block *GetBlockResponse, err error)
func (*MockBeaconInstance) GetForkSchedule ¶ added in v0.20.0
func (c *MockBeaconInstance) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
func (*MockBeaconInstance) GetGenesis ¶ added in v0.14.0
func (c *MockBeaconInstance) GetGenesis() (*GetGenesisResponse, error)
func (*MockBeaconInstance) GetProposerDuties ¶ added in v0.5.1
func (c *MockBeaconInstance) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
func (*MockBeaconInstance) GetRandao ¶ added in v0.14.0
func (c *MockBeaconInstance) GetRandao(slot uint64) (spec *GetRandaoResponse, err error)
func (*MockBeaconInstance) GetSpec ¶ added in v0.14.0
func (c *MockBeaconInstance) GetSpec() (spec *GetSpecResponse, err error)
func (*MockBeaconInstance) GetStateValidators ¶ added in v0.20.0
func (c *MockBeaconInstance) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
func (*MockBeaconInstance) GetURI ¶ added in v0.5.1
func (c *MockBeaconInstance) GetURI() string
func (*MockBeaconInstance) GetWithdrawals ¶ added in v0.20.0
func (c *MockBeaconInstance) GetWithdrawals(slot uint64) (spec *GetWithdrawalsResponse, err error)
func (*MockBeaconInstance) IsValidator ¶ added in v0.5.1
func (c *MockBeaconInstance) IsValidator(pubkey common.PubkeyHex) bool
func (*MockBeaconInstance) NumValidators ¶ added in v0.5.1
func (c *MockBeaconInstance) NumValidators() uint64
func (*MockBeaconInstance) PublishBlock ¶ added in v0.6.0
func (c *MockBeaconInstance) PublishBlock(block *common.VersionedSignedBlockRequest, broadcaseMode BroadcastMode) (code int, err error)
func (*MockBeaconInstance) SetValidators ¶ added in v0.5.1
func (c *MockBeaconInstance) SetValidators(validatorSet map[common.PubkeyHex]ValidatorResponseEntry)
func (*MockBeaconInstance) SubscribeToHeadEvents ¶ added in v0.5.1
func (c *MockBeaconInstance) SubscribeToHeadEvents(slotC chan HeadEventData)
func (*MockBeaconInstance) SubscribeToPayloadAttributesEvents ¶ added in v0.20.0
func (c *MockBeaconInstance) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent)
func (*MockBeaconInstance) SyncStatus ¶ added in v0.5.1
func (c *MockBeaconInstance) SyncStatus() (*SyncStatusPayloadData, error)
type MockMultiBeaconClient ¶ added in v0.24.0
type MockMultiBeaconClient struct{}
func NewMockMultiBeaconClient ¶ added in v0.24.0
func NewMockMultiBeaconClient() *MockMultiBeaconClient
func (*MockMultiBeaconClient) BestSyncStatus ¶ added in v0.24.0
func (*MockMultiBeaconClient) BestSyncStatus() (*SyncStatusPayloadData, error)
func (*MockMultiBeaconClient) GetBlock ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetBlock(blockID string) (block *GetBlockResponse, err error)
func (*MockMultiBeaconClient) GetForkSchedule ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
func (*MockMultiBeaconClient) GetGenesis ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetGenesis() (*GetGenesisResponse, error)
func (*MockMultiBeaconClient) GetProposerDuties ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
func (*MockMultiBeaconClient) GetRandao ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetRandao(slot uint64) (spec *GetRandaoResponse, err error)
func (*MockMultiBeaconClient) GetSpec ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetSpec() (spec *GetSpecResponse, err error)
func (*MockMultiBeaconClient) GetStateValidators ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
func (*MockMultiBeaconClient) GetWithdrawals ¶ added in v0.24.0
func (*MockMultiBeaconClient) GetWithdrawals(slot uint64) (spec *GetWithdrawalsResponse, err error)
func (*MockMultiBeaconClient) PublishBlock ¶ added in v0.24.0
func (*MockMultiBeaconClient) PublishBlock(block *common.VersionedSignedBlockRequest) (code int, err error)
func (*MockMultiBeaconClient) SubscribeToHeadEvents ¶ added in v0.24.0
func (*MockMultiBeaconClient) SubscribeToHeadEvents(slotC chan HeadEventData)
func (*MockMultiBeaconClient) SubscribeToPayloadAttributesEvents ¶ added in v0.24.0
func (*MockMultiBeaconClient) SubscribeToPayloadAttributesEvents(payloadAttrC chan PayloadAttributesEvent)
type MultiBeaconClient ¶ added in v0.5.1
type MultiBeaconClient struct {
// contains filtered or unexported fields
}
func NewMultiBeaconClient ¶ added in v0.5.1
func NewMultiBeaconClient(log *logrus.Entry, beaconInstances []IBeaconInstance) *MultiBeaconClient
func (*MultiBeaconClient) BestSyncStatus ¶ added in v0.5.1
func (c *MultiBeaconClient) BestSyncStatus() (*SyncStatusPayloadData, error)
func (*MultiBeaconClient) GetBlock ¶ added in v0.14.0
func (c *MultiBeaconClient) GetBlock(blockID string) (block *GetBlockResponse, err error)
GetBlock returns a block - https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockV2
func (*MultiBeaconClient) GetForkSchedule ¶ added in v0.20.0
func (c *MultiBeaconClient) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
GetForkSchedule - https://ethereum.github.io/beacon-APIs/#/Config/getForkSchedule
func (*MultiBeaconClient) GetGenesis ¶ added in v0.14.0
func (c *MultiBeaconClient) GetGenesis() (genesisInfo *GetGenesisResponse, err error)
GetGenesis returns the genesis info - https://ethereum.github.io/beacon-APIs/#/Beacon/getGenesis
func (*MultiBeaconClient) GetProposerDuties ¶ added in v0.5.1
func (c *MultiBeaconClient) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
func (*MultiBeaconClient) GetRandao ¶ added in v0.14.0
func (c *MultiBeaconClient) GetRandao(slot uint64) (randaoResp *GetRandaoResponse, err error)
GetRandao - 3500/eth/v1/beacon/states/<slot>/randao
func (*MultiBeaconClient) GetSpec ¶ added in v0.14.0
func (c *MultiBeaconClient) GetSpec() (spec *GetSpecResponse, err error)
GetSpec - https://ethereum.github.io/beacon-APIs/#/Config/getSpec
func (*MultiBeaconClient) GetStateValidators ¶ added in v0.20.0
func (c *MultiBeaconClient) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
GetStateValidators returns all known validators, and queries the beacon nodes in reverse order (because it is a heavy request for the CL client)
func (*MultiBeaconClient) GetWithdrawals ¶ added in v0.20.0
func (c *MultiBeaconClient) GetWithdrawals(slot uint64) (withdrawalsResp *GetWithdrawalsResponse, err error)
GetWithdrawals - 3500/eth/v1/beacon/states/<slot>/withdrawals
func (*MultiBeaconClient) PublishBlock ¶ added in v0.6.0
func (c *MultiBeaconClient) PublishBlock(block *common.VersionedSignedBlockRequest) (code int, err error)
PublishBlock publishes the signed beacon block via https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock
func (*MultiBeaconClient) SubscribeToHeadEvents ¶ added in v0.5.1
func (c *MultiBeaconClient) SubscribeToHeadEvents(slotC chan HeadEventData)
SubscribeToHeadEvents subscribes to head events from all beacon nodes. A single head event will be received multiple times, likely once for every beacon nodes.
func (*MultiBeaconClient) SubscribeToPayloadAttributesEvents ¶ added in v0.20.0
func (c *MultiBeaconClient) SubscribeToPayloadAttributesEvents(slotC chan PayloadAttributesEvent)
type PayloadAttributes ¶ added in v0.20.0
type PayloadAttributesEvent ¶ added in v0.20.0
type PayloadAttributesEvent struct { Version string `json:"version"` Data PayloadAttributesEventData `json:"data"` }
PayloadAttributesEvent represents the data of a payload_attributes event {"version": "capella", "data": {"proposer_index": "123", "proposal_slot": "10", "parent_block_number": "9", "parent_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "parent_block_hash": "0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "payload_attributes": {"timestamp": "123456", "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "suggested_fee_recipient": "0x0000000000000000000000000000000000000000", "withdrawals": [{"index": "5", "validator_index": "10", "address": "0x0000000000000000000000000000000000000000", "amount": "15640"}]}}}
type PayloadAttributesEventData ¶ added in v0.20.0
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 ProdBeaconInstance ¶ added in v0.5.1
type ProdBeaconInstance struct {
// contains filtered or unexported fields
}
func NewProdBeaconInstance ¶ added in v0.5.1
func NewProdBeaconInstance(log *logrus.Entry, beaconURI string) *ProdBeaconInstance
func (*ProdBeaconInstance) CurrentSlot ¶ added in v0.5.1
func (c *ProdBeaconInstance) CurrentSlot() (uint64, error)
func (*ProdBeaconInstance) GetBlock ¶ added in v0.5.1
func (c *ProdBeaconInstance) GetBlock(blockID string) (block *GetBlockResponse, err error)
GetBlock returns a block - https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockV2 blockID can be 'head' or slot number
func (*ProdBeaconInstance) GetBlockForSlot ¶ added in v0.12.3
func (c *ProdBeaconInstance) GetBlockForSlot(slot uint64) (*GetBlockResponse, error)
GetBlockForSlot returns the block for a given slot - https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockV2
func (*ProdBeaconInstance) GetForkSchedule ¶ added in v0.20.0
func (c *ProdBeaconInstance) GetForkSchedule() (spec *GetForkScheduleResponse, err error)
GetForkSchedule - https://ethereum.github.io/beacon-APIs/#/Config/getForkSchedule
func (*ProdBeaconInstance) GetGenesis ¶ added in v0.14.0
func (c *ProdBeaconInstance) GetGenesis() (*GetGenesisResponse, error)
GetGenesis returns the genesis info - https://ethereum.github.io/beacon-APIs/#/Beacon/getGenesis
func (*ProdBeaconInstance) GetHeader ¶ added in v0.5.1
func (c *ProdBeaconInstance) GetHeader() (*GetHeaderResponse, error)
GetHeader returns the latest header - https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockHeader
func (*ProdBeaconInstance) GetHeaderForSlot ¶ added in v0.12.3
func (c *ProdBeaconInstance) GetHeaderForSlot(slot uint64) (*GetHeaderResponse, error)
GetHeaderForSlot returns the header for a given slot - https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockHeader
func (*ProdBeaconInstance) GetProposerDuties ¶ added in v0.5.1
func (c *ProdBeaconInstance) GetProposerDuties(epoch uint64) (*ProposerDutiesResponse, error)
GetProposerDuties returns proposer duties for every slot in this epoch https://ethereum.github.io/beacon-APIs/#/Validator/getProposerDuties
func (*ProdBeaconInstance) GetRandao ¶ added in v0.14.0
func (c *ProdBeaconInstance) GetRandao(slot uint64) (randaoResp *GetRandaoResponse, err error)
GetRandao - /eth/v1/beacon/states/<slot>/randao
func (*ProdBeaconInstance) GetSpec ¶ added in v0.14.0
func (c *ProdBeaconInstance) GetSpec() (spec *GetSpecResponse, err error)
GetSpec - https://ethereum.github.io/beacon-APIs/#/Config/getSpec
func (*ProdBeaconInstance) GetStateValidators ¶ added in v0.20.0
func (c *ProdBeaconInstance) GetStateValidators(stateID string) (*GetStateValidatorsResponse, error)
GetStateValidators loads all active and pending validators https://ethereum.github.io/beacon-APIs/#/Beacon/getStateValidators
func (*ProdBeaconInstance) GetURI ¶ added in v0.5.1
func (c *ProdBeaconInstance) GetURI() string
func (*ProdBeaconInstance) GetWithdrawals ¶ added in v0.20.0
func (c *ProdBeaconInstance) GetWithdrawals(slot uint64) (withdrawalsResp *GetWithdrawalsResponse, err error)
GetWithdrawals - /eth/v1/beacon/states/<slot>/withdrawals
func (*ProdBeaconInstance) PublishBlock ¶ added in v0.6.0
func (c *ProdBeaconInstance) PublishBlock(block *common.VersionedSignedBlockRequest, broadcastMode BroadcastMode) (code int, err error)
func (*ProdBeaconInstance) SubscribeToHeadEvents ¶ added in v0.5.1
func (c *ProdBeaconInstance) SubscribeToHeadEvents(slotC chan HeadEventData)
func (*ProdBeaconInstance) SubscribeToPayloadAttributesEvents ¶ added in v0.20.0
func (c *ProdBeaconInstance) SubscribeToPayloadAttributesEvents(payloadAttributesC chan PayloadAttributesEvent)
func (*ProdBeaconInstance) SyncStatus ¶ added in v0.5.1
func (c *ProdBeaconInstance) SyncStatus() (*SyncStatusPayloadData, error)
SyncStatus returns the current node sync-status https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getSyncingStatus
type ProposerDutiesResponse ¶
type ProposerDutiesResponse struct {
Data []ProposerDutiesResponseData
}
type SyncStatusPayload ¶
type SyncStatusPayload struct {
Data SyncStatusPayloadData
}
SyncStatusPayload is the response payload for /eth/v1/node/syncing {"data":{"head_slot":"251114","sync_distance":"0","is_syncing":false,"is_optimistic":false}}
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"` WithdrawalCredentials string `json:"withdrawal_credentials"` EffectiveBalance string `json:"effective_balance"` Slashed bool `json:"slashed"` ActivationEligibility uint64 `json:"activation_eligibility_epoch,string"` ActivationEpoch uint64 `json:"activation_epoch,string"` ExitEpoch uint64 `json:"exit_epoch,string"` WithdrawableEpoch uint64 `json:"withdrawable_epoch,string"` }