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 ¶
func (h *MemoryAccountWithDataUpdateHandler) Handle(ctx context.Context, update *geyserpb.AccountUpdate) error
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
Click to show internal directories.
Click to hide internal directories.