carbon_core

Module datasource

source
Expand description

Provides traits and structures for managing and consuming data updates from various sources.

The datasource module defines the Datasource trait and associated data types for handling updates related to accounts, transactions, and account deletions. This module allows for flexible data ingestion from various Solana data sources, enabling integration with the carbon-core processing pipeline.

§Overview

The core component of this module is the Datasource trait, which represents an interface for consuming data updates asynchronously. Implementations of Datasource provide the logic for fetching data updates and delivering them via a channel to the pipeline. Different types of updates are represented by the Update enum, including:

  • AccountUpdate: Represents updates to accounts, including the account’s public key, slot, and other account data.
  • TransactionUpdate: Represents transaction updates, including transaction details, signature, and status metadata.
  • AccountDeletion: Represents account deletion events, indicating when an account is removed from the blockchain state.

The module also includes the UpdateType enum to categorize the kinds of updates that a data source can provide.

§Notes

  • The Datasource trait is asynchronous and should be used within a Tokio runtime.
  • Use the Update enum to encapsulate data updates of different types. This helps centralize handling of all update kinds in the pipeline.
  • Ensure implementations handle errors gracefully, especially when fetching data and sending updates to the pipeline.

Structs§

  • Represents the deletion of a Solana account, containing the account’s public key and slot information.
  • Represents an update to a Solana account, including its public key, data, and slot information.
  • Represents a transaction update in the Solana network, including transaction metadata, status, and slot information.

Enums§

  • Represents a data update in the carbon-core pipeline, encompassing different update types.
  • Enumerates the types of updates a datasource can provide.

Traits§

  • Defines the interface for data sources that produce updates for accounts, transactions, and account deletions.