geyser

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrpcPluginEndointConfigEnvName = envConfigPrefix + "GRPC_PLUGIN_ENDPOINT"

	ProgramUpdateWorkerCountConfigEnvName = envConfigPrefix + "PROGRAM_UPDATE_WORKER_COUNT"

	ProgramUpdateQueueSizeConfigEnvName = envConfigPrefix + "PROGRAM_UPDATE_QUEUE_SIZE"

	VmAccountConfigEnvName = envConfigPrefix + "VM_ACCOUNT"

	MemoryAccountBackupWorkerIntervalConfigEnvName = envConfigPrefix + "MEMORY_ACCOUNT_BACKUP_WORKER_INTERVAL"
)

Variables

View Source
var (
	ErrSubscriptionFallenBehind = errors.New("subscription stream fell behind")
	ErrTimeoutReceivingUpdate   = errors.New("timed out receiving update")
)

Functions

This section is empty.

Types

type ConfigProvider

type ConfigProvider func() *conf

ConfigProvider defines how config values are pulled

func WithEnvConfigs

func WithEnvConfigs() ConfigProvider

WithEnvConfigs returns configuration pulled from environment variables

type MemoryAccountWithDataUpdateHandler

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

func (*MemoryAccountWithDataUpdateHandler) Handle

Handle implements geyser.ProgramAccountUpdateHandler.Handle

func (*MemoryAccountWithDataUpdateHandler) RunBackupWorker

func (h *MemoryAccountWithDataUpdateHandler) RunBackupWorker(ctx context.Context) error

RunBackupWorker implements geyser.ProgramAccountUpdateHandler.RunBackupWorker

type ProgramAccountUpdateHandler

type ProgramAccountUpdateHandler interface {
	// Handle handles account updates from Geyser. Updates are not guaranteed
	// to come in order. Implementations must be idempotent and should not
	// trust the account data passed in. Always refer to finalized blockchain
	// state from another RPC provider.
	Handle(ctx context.Context, update *geyserpb.AccountUpdate) error

	// RunBackupWorker runs the backup worker for the handler, which should
	// periodically fill any gaps of data due to missed real-time events from
	// Geyser.
	RunBackupWorker(ctx context.Context) error
}

func NewMemoryAccountWithDataUpdateHandler

func NewMemoryAccountWithDataUpdateHandler(solanaClient solana.Client, ramStore ram.Store, backupWorkerInterval time.Duration, vmsToObserve ...string) ProgramAccountUpdateHandler

NewMemoryAccountWithDataUpdateHandler returns a new ProgramAccountUpdateHandler for observing and persisting state changes to a MemoryAccountWithData account

type Worker

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

func NewWorker

func NewWorker(ctx context.Context, solanaClient solana.Client, ramStore ram.Store, configProvider ConfigProvider) *Worker

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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