Expand description
§Data Anchor API
This crate defines the API interfaces used when interacting with the Data Anchor indexer service.
§API
The indexer service exposes data via a JSONRPC server.
Here is an overview of the available methods:
§get_blobs
Retrieve a list of blobs for a given slot and blober pubkey. Returns an error if there was a database or RPC failure, and None if the slot has not been completed yet. If the slot is completed but no blobs were uploaded, an empty list will be returned.
§Signature
async fn get_blobs(&self, blober: Pubkey, slot: u64) -> RpcResult<Option<Vec<Vec<u8>>>>;§get_blobs_by_blober
Retrieve a list of blobs for a given blober pubkey and time range. Returns an error if there was a database or RPC failure, and an empty list if no blobs were found.
§Signature
async fn get_blobs_by_blober(&self, blober: BlobsByBlober) -> RpcResult<Vec<Vec<u8>>>;Parameters:
pub struct TimeRange {
pub start: Option<DateTime<Utc>>,
pub end: Option<DateTime<Utc>>,
}
pub struct BlobsByBlober {
pub blober: Pubkey,
#[serde(flatten)]
pub time_range: TimeRange,
}Which equals to the following options in JSON:
{
"blober": "BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK"
}{
"blober": "BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK",
"start": "2025-06-09T14:35:06.538958843Z"
}{
"blober": "BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK",
"start": "2025-06-09T14:30:06.538958843Z",
"end": "2025-06-09T14:35:06.538958843Z"
}§get_blobs_by_payer
Retrieve a list of blobs for a given payer pubkey, network ID, and time range. Returns an error if there was a database or RPC failure, and an empty list if no blobs were found.
§Signature
async fn get_blobs_by_payer(&self, payer: BlobsByPayer) -> RpcResult<Vec<Vec<u8>>>;Parameters:
pub struct BlobsByPayer {
pub payer: Pubkey,
pub network_name: String,
#[serde(flatten)]
pub time_range: TimeRange,
}Which equals to the following options in JSON:
{
"payer": "BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK",
"network_name": "ping"
}{
"payer": "BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK",
"network_name": "ping",
"start": "2025-06-09T14:35:06.538958843Z"
}{
"payer": "BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK",
"network_name": "ping",
"start": "2025-06-09T14:30:06.538958843Z",
"end": "2025-06-09T14:35:06.538958843Z"
}§get_proof
Retrieve a proof for a given slot and blober pubkey. Returns an error if there was a database or RPC failure, and None if the slot has not been completed yet.
§Signature
async fn get_proof(&self, blober: Pubkey, slot: u64) -> RpcResult<Option<CompoundProof>>;§get_proof_for_blob
Retrieve a compound proof that covers a particular blob. Returns an error if there was a database or RPC failure, and None if the blob does not exist.
§Signature
async fn get_proof_for_blob(&self, blob_address: Pubkey) -> RpcResult<Option<CompoundProof>>;§Usage
To use the indexer API you can either use our pre-built CLI, Rust client, or if calling from any other
language, simply create and send JSONRPC requests.
§curl example
curl "<INDEXER-URL>" -XPOST \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"get_blobs","params":["BAugq2PZwXBCw72YTRe93kgw3X6ghB3HfF7eSYBDhTsK",385430344]}'Structs§
- Blober
Data - A data structure representing a blober’s information, including the blober’s pubkey, the payer’s pubkey, and the network of the blober.
- Blobs
ByBlober - Request parameters for retrieving blobs by a specific blober’s pubkey and a time range.
- Blobs
ByPayer - Request parameters for retrieving blobs by a specific payer’s pubkey, network ID, and a time range.
- Pubkey
From Str - A wrapper around a blober’s pubkey, used to identify a blober in RPC calls.
- Relevant
Blober Instruction With Pubkey - A deserialized relevant blober instruction, containing the blober pubkey and the instruction.
- Relevant
Instruction With Accounts - A deserialized relevant instruction, containing the blob and blober pubkeys and the instruction.
- Time
Range - A time range with optional start and end times, used for filtering time.
- Versioned
Transaction With Inner Instructions
Enums§
- Compound
Proof - A compound proof that proves whether a blob has been published in a specific slot.
See
CompoundInclusionProofandCompoundCompletenessProoffor more information. - Ledger
Data Blob Error - Errors that can occur when fetching blob data from the ledger.
- Relevant
Blober Instruction - Blober instructions that are relevant to the indexer.
- Relevant
Instruction - A relevant
data_anchor_bloberinstruction extracted from aVersionedTransaction.
Traits§
- Indexer
RpcClient - Client implementation for the
IndexerRpcRPC API. - Indexer
RpcServer - Server trait implementation for the
IndexerRpcRPC API.
Functions§
- deserialize_
blober_ instructions - Deserialize blober instructions from a transaction, returning a vector of
RelevantBloberInstructionWithPubkey. - deserialize_
relevant_ instructions - Deserialize relevant instructions from a transaction, given the indices of the blob and blober accounts in the transaction.
- extract_
relevant_ instructions - Extract relevant instructions from a list of transactions.
- get_
account_ at_ index - Performs the double-lookup required to find an account at a given account index in an instruction.
This is required because the accounts are not stored in the instruction directly, but in a separate
account list. It is computed as
payload.account_keys[instruction.accounts[index]]. - get_
blob_ data_ from_ instructions - Extracts the blob data from the relevant instructions.