Documentation
¶
Index ¶
- Variables
- type RpcClient
- func (fetcher *RpcClient) DownloadBlocksToFile(outDir string, slot uint64, num int64)
- func (c *RpcClient) Endpoint() string
- func (fetcher *RpcClient) GetBlock(slot uint64) (*rpc.GetBlockResult, error)
- func (fetcher *RpcClient) GetBlockConfirmed(slot uint64) (*rpc.GetBlockResult, error)
- func (fetcher *RpcClient) GetBlockConfirmedOnce(slot uint64) (*rpc.GetBlockResult, error)
- func (fetcher *RpcClient) GetBlockFinalized(slot uint64) (*rpc.GetBlockResult, error)
- func (fetcher *RpcClient) GetBlockTime(slot uint64) (int64, error)
- func (fetcher *RpcClient) GetLatestBlockConfirmed() (*rpc.GetBlockResult, error)
- func (fetcher *RpcClient) GetLatestBlockFinalized() (*rpc.GetBlockResult, error)
- func (fetcher *RpcClient) GetLeaderForSlot(slot uint64) (solana.PublicKey, error)
- func (fetcher *RpcClient) GetLeaderSchedule() (map[solana.PublicKey][]uint64, error)
- func (fetcher *RpcClient) GetLeaderScheduleForEpoch(epoch uint64) (map[solana.PublicKey][]uint64, error)
- func (fetcher *RpcClient) GetNumRewardPartitions(slot uint64) (uint64, error)
- func (fetcher *RpcClient) GetRewardSlots(slot uint64) ([]rpc.BlockReward, *uint64, error)
- func (fetcher *RpcClient) GetRewardsForSlot(slot uint64) ([]rpc.BlockReward, error)
- func (fetcher *RpcClient) GetSlot() (uint64, error)
- func (fetcher *RpcClient) GetSlotProcessedWithTimeout(timeout time.Duration) (uint64, error)
- func (fetcher *RpcClient) GetSlotWithTimeout(timeout time.Duration) (uint64, error)
- func (fetcher *RpcClient) GetSlotWithTimeoutAndCommitment(timeout time.Duration, commitment rpc.CommitmentType) (uint64, error)
- func (fetcher *RpcClient) GetStakingRewardSlots(startSlot uint64, numPartitions uint64) ([]uint64, error)
- func (fetcher *RpcClient) GetTransactionMeta(sig solana.Signature) (*rpc.TransactionMeta, error)
Constants ¶
This section is empty.
Variables ¶
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 (*RpcClient) DownloadBlocksToFile ¶
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) GetLatestBlockConfirmed ¶
func (fetcher *RpcClient) GetLatestBlockConfirmed() (*rpc.GetBlockResult, error)
func (*RpcClient) GetLatestBlockFinalized ¶
func (fetcher *RpcClient) GetLatestBlockFinalized() (*rpc.GetBlockResult, error)
func (*RpcClient) GetLeaderForSlot ¶
func (*RpcClient) GetLeaderSchedule ¶
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 (*RpcClient) GetRewardSlots ¶
func (*RpcClient) GetRewardsForSlot ¶
func (fetcher *RpcClient) GetRewardsForSlot(slot uint64) ([]rpc.BlockReward, error)
func (*RpcClient) GetSlotProcessedWithTimeout ¶
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 ¶
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.