Documentation ¶
Index ¶
- type BlockRewardService
- func (rs *BlockRewardService) GetBlockRewardsData(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock) (*structs.BlockRewards, *httputil.DefaultJsonError)
- func (rs *BlockRewardService) GetStateForRewards(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock) (state.BeaconState, *httputil.DefaultJsonError)
- type BlockRewardsFetcher
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockRewardService ¶
type BlockRewardService struct { Replayer stategen.ReplayerBuilder DB db.HeadAccessDatabase }
BlockRewardService implements BlockRewardsFetcher and can be declared to access the underlying functions
func (*BlockRewardService) GetBlockRewardsData ¶
func (rs *BlockRewardService) GetBlockRewardsData(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock) (*structs.BlockRewards, *httputil.DefaultJsonError)
GetBlockRewardsData returns the BlockRewards object which is used for the BlockRewardsResponse and ProduceBlockV3. Rewards are denominated in Gwei.
func (*BlockRewardService) GetStateForRewards ¶
func (rs *BlockRewardService) GetStateForRewards(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock) (state.BeaconState, *httputil.DefaultJsonError)
GetStateForRewards returns the state replayed up to the block's slot
type BlockRewardsFetcher ¶
type BlockRewardsFetcher interface { GetBlockRewardsData(context.Context, interfaces.ReadOnlyBeaconBlock) (*structs.BlockRewards, *httputil.DefaultJsonError) GetStateForRewards(context.Context, interfaces.ReadOnlyBeaconBlock) (state.BeaconState, *httputil.DefaultJsonError) }
BlockRewardsFetcher is a interface that provides access to reward related responses
type Server ¶
type Server struct { Blocker lookup.Blocker OptimisticModeFetcher blockchain.OptimisticModeFetcher FinalizationFetcher blockchain.FinalizationFetcher TimeFetcher blockchain.TimeFetcher Stater lookup.Stater HeadFetcher blockchain.HeadFetcher BlockRewardFetcher BlockRewardsFetcher }
func (*Server) AttestationRewards ¶
func (s *Server) AttestationRewards(w http.ResponseWriter, r *http.Request)
AttestationRewards retrieves attestation reward info for validators specified by array of public keys or validator index. If no array is provided, return reward info for every validator.
func (*Server) BlockRewards ¶
func (s *Server) BlockRewards(w http.ResponseWriter, r *http.Request)
BlockRewards is an HTTP handler for Beacon API getBlockRewards.
func (*Server) SyncCommitteeRewards ¶
func (s *Server) SyncCommitteeRewards(w http.ResponseWriter, r *http.Request)
SyncCommitteeRewards retrieves rewards info for sync committee members specified by array of public keys or validator index. If no array is provided, return reward info for every committee member.