rpc

package
v0.0.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StreamBlockEvent     uint16 = 0x01
	StreamHeadEvent      uint16 = 0x02
	StreamFinalizedEvent uint16 = 0x04
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconClient

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

func NewBeaconClient

func NewBeaconClient(name, url string, headers map[string]string) (*BeaconClient, error)

NewBeaconClient is used to create a new beacon client

func (*BeaconClient) GetBlockBodyByBlockroot

func (bc *BeaconClient) GetBlockBodyByBlockroot(ctx context.Context, blockroot phase0.Root) (*spec.VersionedSignedBeaconBlock, error)

func (*BeaconClient) GetBlockHeaderByBlockroot

func (bc *BeaconClient) GetBlockHeaderByBlockroot(ctx context.Context, blockroot phase0.Root) (*v1.BeaconBlockHeader, error)

func (*BeaconClient) GetBlockHeaderBySlot

func (bc *BeaconClient) GetBlockHeaderBySlot(ctx context.Context, slot phase0.Slot) (*v1.BeaconBlockHeader, error)

func (*BeaconClient) GetCommitteeDuties

func (bc *BeaconClient) GetCommitteeDuties(ctx context.Context, stateRef string, epoch uint64) ([]*v1.BeaconCommittee, error)

func (*BeaconClient) GetConfigSpecs

func (bc *BeaconClient) GetConfigSpecs(ctx context.Context) (map[string]interface{}, error)

func (*BeaconClient) GetFinalityCheckpoints

func (bc *BeaconClient) GetFinalityCheckpoints(ctx context.Context) (*v1.Finality, error)

func (*BeaconClient) GetForkState

func (bc *BeaconClient) GetForkState(ctx context.Context, stateRef string) (*phase0.Fork, error)

func (*BeaconClient) GetGenesis

func (bc *BeaconClient) GetGenesis(ctx context.Context) (*v1.Genesis, error)

func (*BeaconClient) GetLatestBlockHead

func (bc *BeaconClient) GetLatestBlockHead(ctx context.Context) (*v1.BeaconBlockHeader, error)

func (*BeaconClient) GetNodeSyncStatus

func (bc *BeaconClient) GetNodeSyncStatus(ctx context.Context) (*SyncStatus, error)

func (*BeaconClient) GetNodeSyncing

func (bc *BeaconClient) GetNodeSyncing(ctx context.Context) (*v1.SyncState, error)

func (*BeaconClient) GetNodeVersion

func (bc *BeaconClient) GetNodeVersion(ctx context.Context) (string, error)

func (*BeaconClient) GetProposerDuties

func (bc *BeaconClient) GetProposerDuties(ctx context.Context, epoch uint64) ([]*v1.ProposerDuty, error)

func (*BeaconClient) GetState

func (bc *BeaconClient) GetState(ctx context.Context, stateRef string) (*spec.VersionedBeaconState, error)

func (*BeaconClient) GetStateValidators

func (bc *BeaconClient) GetStateValidators(ctx context.Context, stateRef string) (map[phase0.ValidatorIndex]*v1.Validator, error)

func (*BeaconClient) Initialize

func (bc *BeaconClient) Initialize(ctx context.Context) error

func (*BeaconClient) NewBlockStream

func (bc *BeaconClient) NewBlockStream(ctx context.Context, events uint16) *BeaconStream

func (*BeaconClient) SubmitAttesterSlashing

func (bc *BeaconClient) SubmitAttesterSlashing(ctx context.Context, slashing *phase0.AttesterSlashing) error

func (*BeaconClient) SubmitBLSToExecutionChanges

func (bc *BeaconClient) SubmitBLSToExecutionChanges(ctx context.Context, blsChanges []*capella.SignedBLSToExecutionChange) error

func (*BeaconClient) SubmitProposerSlashing

func (bc *BeaconClient) SubmitProposerSlashing(ctx context.Context, slashing *phase0.ProposerSlashing) error

func (*BeaconClient) SubmitVoluntaryExits

func (bc *BeaconClient) SubmitVoluntaryExits(ctx context.Context, exit *phase0.SignedVoluntaryExit) error

type BeaconStream

type BeaconStream struct {
	ReadyChan chan bool
	EventChan chan *BeaconStreamEvent
	// contains filtered or unexported fields
}

func (*BeaconStream) Close

func (bs *BeaconStream) Close()

type BeaconStreamEvent

type BeaconStreamEvent struct {
	Event uint16
	Data  interface{}
}

type SyncStatus

type SyncStatus struct {
	IsSyncing                bool
	IsOptimistic             bool
	HeadSlot                 uint64
	EstimatedHighestHeadSlot uint64
	SyncDistance             uint64
}

func NewSyncStatus

func NewSyncStatus(state *v1.SyncState) SyncStatus

func (*SyncStatus) Percent

func (s *SyncStatus) Percent() float64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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