rpcclient

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SlotSkipped = errors.New("slot skipped")

Functions

This section is empty.

Types

type RpcClient

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

func NewRpcClient

func NewRpcClient(endpoint string) *RpcClient

func (*RpcClient) DownloadBlocksToFile

func (fetcher *RpcClient) DownloadBlocksToFile(outDir string, slot uint64, num int64)

func (*RpcClient) Endpoint

func (c *RpcClient) Endpoint() string

Endpoint returns the RPC endpoint URL

func (*RpcClient) GetBlock

func (fetcher *RpcClient) GetBlock(slot uint64) (*rpc.GetBlockResult, error)

func (*RpcClient) GetBlockConfirmed

func (fetcher *RpcClient) GetBlockConfirmed(slot uint64) (*rpc.GetBlockResult, error)

func (*RpcClient) GetBlockConfirmedOnce

func (fetcher *RpcClient) GetBlockConfirmedOnce(slot uint64) (*rpc.GetBlockResult, error)

GetBlockConfirmedOnce fetches a block with a single RPC attempt (no internal retry). Use this with rate-limited parallel fetching where the scheduler handles retries. Uses a 30-second timeout to prevent worker stalls on hung RPC connections.

func (*RpcClient) GetBlockFinalized

func (fetcher *RpcClient) GetBlockFinalized(slot uint64) (*rpc.GetBlockResult, error)

func (*RpcClient) GetBlockTime

func (fetcher *RpcClient) GetBlockTime(slot uint64) (int64, error)

func (*RpcClient) GetLatestBlockConfirmed

func (fetcher *RpcClient) GetLatestBlockConfirmed() (*rpc.GetBlockResult, error)

func (*RpcClient) GetLatestBlockFinalized

func (fetcher *RpcClient) GetLatestBlockFinalized() (*rpc.GetBlockResult, error)

func (*RpcClient) GetLeaderForSlot

func (fetcher *RpcClient) GetLeaderForSlot(slot uint64) (solana.PublicKey, error)

func (*RpcClient) GetLeaderSchedule

func (fetcher *RpcClient) GetLeaderSchedule() (map[solana.PublicKey][]uint64, error)

func (*RpcClient) GetLeaderScheduleForEpoch

func (fetcher *RpcClient) GetLeaderScheduleForEpoch(epoch uint64) (map[solana.PublicKey][]uint64, error)

GetLeaderScheduleForEpoch fetches the leader schedule for a specific epoch. This is needed when validating historical epochs (during catchup) since the default GetLeaderSchedule returns the current epoch's schedule.

func (*RpcClient) GetNumRewardPartitions

func (fetcher *RpcClient) GetNumRewardPartitions(slot uint64) (uint64, error)

func (*RpcClient) GetRewardSlots

func (fetcher *RpcClient) GetRewardSlots(slot uint64) ([]rpc.BlockReward, *uint64, error)

func (*RpcClient) GetRewardsForSlot

func (fetcher *RpcClient) GetRewardsForSlot(slot uint64) ([]rpc.BlockReward, error)

func (*RpcClient) GetSlot

func (fetcher *RpcClient) GetSlot() (uint64, error)

func (*RpcClient) GetSlotProcessedWithTimeout

func (fetcher *RpcClient) GetSlotProcessedWithTimeout(timeout time.Duration) (uint64, error)

GetSlotProcessedWithTimeout returns the current slot with processed commitment. Processed is the most recent slot - useful for measuring true distance to chain tip.

func (*RpcClient) GetSlotWithTimeout

func (fetcher *RpcClient) GetSlotWithTimeout(timeout time.Duration) (uint64, error)

GetSlotWithTimeout returns the current slot with a timeout (confirmed commitment). Useful for health probes where we don't want to block indefinitely.

func (*RpcClient) GetSlotWithTimeoutAndCommitment

func (fetcher *RpcClient) GetSlotWithTimeoutAndCommitment(timeout time.Duration, commitment rpc.CommitmentType) (uint64, error)

GetSlotWithTimeoutAndCommitment returns the current slot with specified commitment and timeout.

func (*RpcClient) GetStakingRewardSlots

func (fetcher *RpcClient) GetStakingRewardSlots(startSlot uint64, numPartitions uint64) ([]uint64, error)

func (*RpcClient) GetTransactionMeta

func (fetcher *RpcClient) GetTransactionMeta(sig solana.Signature) (*rpc.TransactionMeta, error)

Jump to

Keyboard shortcuts

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