eth

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootFromString

func NewRootFromString(id string) (phase0.Root, error)

func NewSlotFromString

func NewSlotFromString(id string) (phase0.Slot, error)

Types

type BlockIDType

type BlockIDType int
const (
	BlockIDInvalid BlockIDType = iota
	BlockIDHead
	BlockIDGenesis
	BlockIDFinalized
	BlockIDSlot
	BlockIDRoot
)

func (BlockIDType) String

func (t BlockIDType) String() string

type BlockIdentifier

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

func NewBlockIdentifier

func NewBlockIdentifier(id string) (BlockIdentifier, error)

func (BlockIdentifier) AsRoot

func (id BlockIdentifier) AsRoot() (phase0.Root, error)

func (BlockIdentifier) AsSlot

func (id BlockIdentifier) AsSlot() (phase0.Slot, error)

func (BlockIdentifier) String

func (id BlockIdentifier) String() string

func (BlockIdentifier) Type

func (id BlockIdentifier) Type() BlockIDType

func (BlockIdentifier) Value

func (id BlockIdentifier) Value() string

type DepositContract

type DepositContract struct {
	ChainID string `json:"chain_id"`
	Address string `json:"address"`
}

type Handler

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

Handler is the Eth Service handler. HTTP-level concerns should NOT be contained in this package, they should be handled and reasoned with at a higher level.

func NewHandler

func NewHandler(log logrus.FieldLogger, beac beacon.FinalityProvider, namespace string) *Handler

NewHandler returns a new Handler instance.

func (*Handler) BeaconBlock

func (h *Handler) BeaconBlock(ctx context.Context, blockID BlockIdentifier) (*spec.VersionedSignedBeaconBlock, error)

BeaconBlock returns the beacon block for the given block ID.

func (*Handler) BeaconGenesis

func (h *Handler) BeaconGenesis(ctx context.Context) (*v1.Genesis, error)

BeaconGenesis returns the details of the chain's genesis.

func (*Handler) BeaconState

func (h *Handler) BeaconState(ctx context.Context, stateID StateIdentifier) (*spec.VersionedBeaconState, error)

BeaconState returns the beacon state for the given state id.

func (*Handler) BlobSidecars added in v0.20.0

func (h *Handler) BlobSidecars(ctx context.Context, blockID BlockIdentifier, indices []int) ([]*deneb.BlobSidecar, error)

BlobSidecars returns the blob sidecars for the given block ID.

func (*Handler) BlockRoot

func (h *Handler) BlockRoot(ctx context.Context, blockID BlockIdentifier) (phase0.Root, error)

BlockRoot returns the beacon block root for the given block ID.

func (*Handler) ConfigSpec

func (h *Handler) ConfigSpec(ctx context.Context) (*state.Spec, error)

ConfigSpec gets the spec configuration.

func (*Handler) DepositContract

func (h *Handler) DepositContract(ctx context.Context) (*DepositContract, error)

DepositContract gets the Eth1 deposit address and chain ID

func (*Handler) DepositSnapshot added in v0.15.0

func (h *Handler) DepositSnapshot(ctx context.Context) (*types.DepositSnapshot, error)

DepositContract gets the deposit snapshot at the finalized checkpoint.

func (*Handler) FinalityCheckpoints

func (h *Handler) FinalityCheckpoints(ctx context.Context, stateID StateIdentifier) (*v1.Finality, error)

FinalityCheckpoints returns the finality checkpoints for the given state id.

func (*Handler) ForkSchedule

func (h *Handler) ForkSchedule(ctx context.Context) ([]*state.ScheduledFork, error)

ForkSchedule returns the upcoming forks.

func (*Handler) NodeSyncing

func (h *Handler) NodeSyncing(ctx context.Context) (*v1.SyncState, error)

NodeSyncing returns the sync state of the beacon node.

func (*Handler) NodeVersion

func (h *Handler) NodeVersion(ctx context.Context) (string, error)

NodeVersion returns the version of the beacon node.

func (*Handler) PeerCount

func (h *Handler) PeerCount(ctx context.Context) (uint64, error)

PeerCount returns the amount of peers connected to the beacon node.

func (*Handler) Peers

func (h *Handler) Peers(ctx context.Context) (types.Peers, error)

Peers returns the peers connected to the beacon node.

type ID

type ID string
const (
	IDInvalid   ID = "invalid"
	IDHead      ID = "head"
	IDGenesis   ID = "genesis"
	IDFinalized ID = "finalized"
	IDSlot      ID = "slot"
	IDRoot      ID = "root"
)

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) ObserveCall

func (m *Metrics) ObserveCall(method, identifier string)

func (*Metrics) ObserveErrorCall

func (m *Metrics) ObserveErrorCall(method, identifier string)

type StateIDType

type StateIDType int
const (
	StateIDInvalid StateIDType = iota
	StateIDHead
	StateIDGenesis
	StateIDFinalized
	StateIDSlot
	StateIDRoot
)

func (StateIDType) String

func (t StateIDType) String() string

type StateIdentifier

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

func NewStateIdentifier

func NewStateIdentifier(id string) (StateIdentifier, error)

func (StateIdentifier) AsRoot

func (id StateIdentifier) AsRoot() (phase0.Root, error)

func (StateIdentifier) AsSlot

func (id StateIdentifier) AsSlot() (phase0.Slot, error)

func (StateIdentifier) String

func (id StateIdentifier) String() string

func (StateIdentifier) Type

func (id StateIdentifier) Type() StateIDType

func (StateIdentifier) Value

func (id StateIdentifier) Value() string

Jump to

Keyboard shortcuts

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