Generate a Yellowstone Vixen Parser with Codama
How-to generate Vixen parser with Codama
This guide walks you through generating a Vixen Parser using Codama, a tool for rendering Rust SDKs and parser implementations from IDLs.
Vixen is a framework for building real-time program data pipelines in Rust. This guide helps you scaffold a parser that can be used in the Vixen runtime to decode and process Solana program data.
✅ Prerequisites
1. Generate a Codama Rust SDK for your program using codama:rust-renderers.
2. You must have an idl.json file—either an Anchor-generated IDL or a custom one.
3. Install pnpm (or use npm/yarn if preferred).
📦 Installation
Install the required Codama packages:
For the parser generation script, you’ll also need:
🛠 Setup
1. Create a New Rust Parser Project
Move your idl.json file into the newly created project folder:
2. Initialize a JavaScript Project (for Codegen)
From within the parser directory:
Install all required JS dependencies (see Installation above).
3. Create a Parser Generation Script
Inside program-parser/
, create a new file called script.cjs:
💡 Tip: Replace "my_program_sdk" with the actual SDK crate name you generated with Codama.
4. Run the Code Generation Script
You should see files generated in src/generated/
.
5. Configure Your Rust Project
Update src/lib.rs:
Update Cargo.toml
:
6. Build and Verify
If successful, you now have a working parser for Solana account data using Yellowstone Vixen.
🎉 You’re Done!
You’ve successfully generated a custom Vixen parser. It can now be integrated into a Vixen pipeline for parsing and handling account state from your Solana program.
🧠 Notes
Codama enables reproducible parser generation from your program’s IDL. Any time your program updates, just re-run the script.
Generated code is idiomatic Rust and integrates directly with yellowstone-vixen-core.
Parsers are composable and can be used in a source → parser → sink pipeline for high-throughput indexing.
Last updated
Was this helpful?