beacon

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpecPath                = "/eth/v1/config/spec"
	SyncPath                = "/eth/v1/node/syncing"
	FinalizedValidatorsPath = "/eth/v1/beacon/states/finalized/validators"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconService

type BeaconService struct {
	// contains filtered or unexported fields
}

func NewBeaconService

func NewBeaconService() *BeaconService

func (*BeaconService) Configure

func (b *BeaconService) Configure(cfg config.BeaconConfig) error

func (*BeaconService) ConnectedChainId

func (b *BeaconService) ConnectedChainId() *big.Int

func (*BeaconService) FinalizedValidatorEffectiveBalance

func (b *BeaconService) FinalizedValidatorEffectiveBalance(blsKeys []phase0.BLSPubKey) (res map[phase0.BLSPubKey]uint64, err error)

func (*BeaconService) Status

func (b *BeaconService) Status() (res *SyncStatusData, err error)

func (*BeaconService) SubscribeToHeadEvents

func (b *BeaconService) SubscribeToHeadEvents(ctx context.Context, headEvent chan<- HeadEventData) error

type GetSyncStatusResponse

type GetSyncStatusResponse struct {
	Data *SyncStatusData `json:"data"`
}

type GetValidatorsResponse

type GetValidatorsResponse struct {
	Data []*ValidatorData `json:"data"`
}

type HeadEventData

type HeadEventData struct {
	Slot  uint64 `json:"slot,string"`
	Block string `json:"block"`
	State string `json:"state"`
}

type SyncStatusData

type SyncStatusData struct {
	HeadSlot     uint64 `json:"head_slot,string"`
	SyncDistance uint64 `json:"sync_distance,string"`
	IsSyncing    bool   `json:"is_syncing"`
	IsOptimistic bool   `json:"is_optimistic"`
	ElOffline    bool   `json:"el_offline"`
}

type Validator

type Validator struct {
	Pubkey                     phase0.BLSPubKey `json:"pubkey"`
	WithdrawalCredentials      string           `json:"withdrawal_credentials"`
	EffectiveBalance           uint64           `json:"effective_balance,string"`
	Slashed                    bool             `json:"slashed"`
	ActivationEligibilityEpoch uint64           `json:"activation_eligibility_epoch,string"`
	ActivationEpoch            uint64           `json:"activation_epoch,string"`
	ExitEpoch                  uint64           `json:"exit_epoch,string"`
	WithdrawableEpoch          uint64           `json:"withdrawable_epoch,string"`
}

type ValidatorData

type ValidatorData struct {
	Index     uint64     `json:"index,string"`
	Balance   uint64     `json:"balance,string"`
	Status    string     `json:"status"`
	Validator *Validator `json:"validator"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL