DriftGrpcClient
TheDriftGrpcClient provides high-performance streaming of account updates, transaction updates, slot updates, and block metadata through Yellowstone gRPC. It supports advanced filtering and runs on a dedicated thread for optimal performance.
Constructor
endpoint- gRPC server endpoint URLx_token- Authentication token for the gRPC service
Configuration
grpc_connection_opts
Callback Registration
on_account
on_account must prioritize fast handling to avoid blocking the gRPC thread.
Parameters:
filter- Filter criteria for matching accountson_account- Callback function invoked on filter matches
on_transaction
transactions_accounts_include in GeyserSubscribeOpts to filter by account.
Example:
on_slot
on_block_meta
Subscription
subscribe
commitment- Commitment level (Processed, Confirmed, or Finalized)subscribe_opts- Subscription options and filters
UnsubHandle- Handle to unsubscribe from the stream