Start From Latest Block
Start block now accepts "latest" instead of an exact block. The indexer will automatically check the height on startup and start indexing from it. See example in Solana config below
Solana Support Now Stable
In this release, we've made the final push to finalize the HyperIndex API for the SVM ecosystem. Amazing DX, performance, flexibility, and now following semver.
Start using it with pnpx envio init and choose one of the Solana templates - powered by HyperSync by default. Configuration, handlers, and everything else are similar to EVM, with some additional improvements.
Start with config.yaml:
# yaml-language-server: $schema=./node_modules/envio/svm.schema.json
name: usdc-transfers
description: USDC Token Transfers
ecosystem: svm
chains:
- id: solana
start_slot: "latest"
programs:
- name: SplToken
program_id: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
idl: ./idls/spl-token.codama.json
And index the way you already know:
import { indexer } from "envio";
const USDC_MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
indexer.onInstruction(
{
program: "SplToken",
instruction: "transferChecked",
fields: {
instruction: ["accounts", "args", "path"],
transaction: ["signature"],
accountActivity: ["token.mint"],
block: ["time"],
},
where: { accounts: { mint: USDC_MINT } },
},
async ({ instruction, context }) => {
context.Transfer.set({
id: `${instruction.transaction.signature}:${instruction.path.join(".")}`,
amount: instruction.args.amount,
source: instruction.accounts.source.address,
destination: instruction.accounts.destination.address,
signer: instruction.accounts.authority.address,
txSignature: instruction.transaction.signature,
checked: true,
slot: instruction.block.slot,
timestamp: instruction.block.time,
});
}
);
With HyperIndex you'll get:
- A powerful data-source integration out of the box
- Automatic decoding and filtering
- Anchor and Codama IDLs support
- Write and aggregate to Postgres and ClickHouse
- Run GraphQL server on top of your Solana data
- Delegate hosting to Envio Cloud