rpc

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 33 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(endpoint string, name string, headers map[string]string, sshcfg *types.EndpointSshConfig) (*BeaconClient, error)

NewBeaconClient is used to create a new beacon client

func (*BeaconClient) GetBlobSidecarsByBlockroot

func (bc *BeaconClient) GetBlobSidecarsByBlockroot(blockroot []byte) ([]*deneb.BlobSidecar, error)

func (*BeaconClient) GetBlockBodyByBlockroot

func (bc *BeaconClient) GetBlockBodyByBlockroot(blockroot []byte) (*spec.VersionedSignedBeaconBlock, error)

func (*BeaconClient) GetBlockHeaderByBlockroot

func (bc *BeaconClient) GetBlockHeaderByBlockroot(blockroot []byte) (*v1.BeaconBlockHeader, error)

func (*BeaconClient) GetBlockHeaderBySlot

func (bc *BeaconClient) GetBlockHeaderBySlot(slot uint64) (*v1.BeaconBlockHeader, error)

func (*BeaconClient) GetCommitteeDuties

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

func (*BeaconClient) GetEpochAssignments

func (bc *BeaconClient) GetEpochAssignments(epoch uint64, dependendRoot []byte) (*EpochAssignments, error)

GetEpochAssignments will get the epoch assignments from Lighthouse RPC api

func (*BeaconClient) GetFinalityCheckpoints

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

func (*BeaconClient) GetGenesis

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

func (*BeaconClient) GetLatestBlockHead

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

func (*BeaconClient) GetNodePeerId added in v1.10.0

func (bc *BeaconClient) GetNodePeerId() (string, error)

func (*BeaconClient) GetNodePeers added in v1.10.0

func (bc *BeaconClient) GetNodePeers() ([]*v1.Peer, error)

func (*BeaconClient) GetNodeSyncing

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

func (*BeaconClient) GetNodeVersion

func (bc *BeaconClient) GetNodeVersion() (string, error)

func (*BeaconClient) GetProposerDuties

func (bc *BeaconClient) GetProposerDuties(epoch uint64) (*ProposerDuties, error)

func (*BeaconClient) GetSpecs

func (bc *BeaconClient) GetSpecs() (map[string]any, error)

func (*BeaconClient) GetState

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

func (*BeaconClient) GetStateValidators

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

func (*BeaconClient) GetSyncCommitteeDuties

func (bc *BeaconClient) GetSyncCommitteeDuties(stateRef string, epoch uint64) (*v1.SyncCommittee, error)

func (*BeaconClient) Initialize

func (bc *BeaconClient) Initialize() error

func (*BeaconClient) NewBlockStream

func (bc *BeaconClient) NewBlockStream(events uint16) *BeaconStream

type BeaconStream

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

func (*BeaconStream) Close

func (bs *BeaconStream) Close()

func (*BeaconStream) Start

func (bs *BeaconStream) Start()

type BeaconStreamEvent

type BeaconStreamEvent struct {
	Event uint16
	Data  interface{}
}

type EpochAssignments

type EpochAssignments struct {
	DependendRoot       phase0.Root         `json:"dep_root"`
	DependendStateRef   string              `json:"dep_state"`
	ProposerAssignments map[uint64]uint64   `json:"prop"`
	AttestorAssignments map[string][]uint64 `json:"att"`
	SyncAssignments     []uint64            `json:"sync"`
}

type ExecutionClient

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

func NewExecutionClient

func NewExecutionClient(name, endpoint string, headers map[string]string, sshcfg *types.EndpointSshConfig) (*ExecutionClient, error)

NewExecutionClient is used to create a new execution client

func (*ExecutionClient) GetAdminNodeInfo added in v1.10.0

func (ec *ExecutionClient) GetAdminNodeInfo(ctx context.Context) (*p2p.NodeInfo, error)

func (*ExecutionClient) GetAdminPeers added in v1.10.0

func (ec *ExecutionClient) GetAdminPeers(ctx context.Context) ([]*p2p.PeerInfo, error)

func (*ExecutionClient) GetBalanceAt

func (ec *ExecutionClient) GetBalanceAt(ctx context.Context, wallet common.Address, blockNumber *big.Int) (*big.Int, error)

func (*ExecutionClient) GetBlockByHash

func (ec *ExecutionClient) GetBlockByHash(ctx context.Context, hash common.Hash) (*ethtypes.Block, error)

func (*ExecutionClient) GetBlockHeaderByNumber

func (ec *ExecutionClient) GetBlockHeaderByNumber(ctx context.Context, number uint64) (*ethtypes.Header, error)

func (*ExecutionClient) GetChainId

func (ec *ExecutionClient) GetChainId(ctx context.Context) (*big.Int, error)

func (*ExecutionClient) GetClientVersion

func (ec *ExecutionClient) GetClientVersion(ctx context.Context) (string, error)

func (*ExecutionClient) GetEthClient

func (ec *ExecutionClient) GetEthClient() *ethclient.Client

func (*ExecutionClient) GetLatestBlockHeader

func (ec *ExecutionClient) GetLatestBlockHeader(ctx context.Context) (*ethtypes.Header, error)

func (*ExecutionClient) GetNodeSyncing

func (ec *ExecutionClient) GetNodeSyncing(ctx context.Context) (*ExecutionSyncStatus, error)

func (*ExecutionClient) GetNonceAt

func (ec *ExecutionClient) GetNonceAt(ctx context.Context, wallet common.Address, blockNumber *big.Int) (uint64, error)

func (*ExecutionClient) GetTransactionReceipt

func (ec *ExecutionClient) GetTransactionReceipt(ctx context.Context, txHash common.Hash) (*ethtypes.Receipt, error)

func (*ExecutionClient) Initialize

func (ec *ExecutionClient) Initialize(ctx context.Context) error

func (*ExecutionClient) SendTransaction

func (ec *ExecutionClient) SendTransaction(ctx context.Context, tx *ethtypes.Transaction) error

type ExecutionSyncStatus

type ExecutionSyncStatus struct {
	IsSyncing     bool
	StartingBlock uint64
	CurrentBlock  uint64
	HighestBlock  uint64
}

func (*ExecutionSyncStatus) Percent

func (s *ExecutionSyncStatus) Percent() float64

type ProposerDuties

type ProposerDuties struct {
	DependentRoot phase0.Root        `json:"dependent_root"`
	Data          []*v1.ProposerDuty `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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