Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

carbon

> 编程语言
Open source

Carbon is an indexing framework on Solana.

613 stars0 likes0 views
WebsiteGitHub

About

Carbon is an indexing framework on Solana.


✨ Overview

Carbon is built around a pipeline: datasources stream Solana updates into the runtime, decoders turn raw account and transaction data into typed Rust structures, and processors handle the decoded output in order to build data pipelines and indexers for your applications. Each part is modular, so you can swap RPC streams for Geyser streams, generated decoders for custom ones, or logging processors for Postgres, GraphQL, analytics, bots, and other application-specific sinks.


Quick Start

Start with a decoder. Use one of Carbon's existing program decoders, or generate one from your program IDL:

bash
npx @sevenlabs-hq/carbon-cli parse \
  --idl ./idl.json \
  --out-dir ./my-program-decoder \
  --name my-program

Then add a datasource and wire them together in a pipeline:

…

Then implement a processor for the typed instruction data you care about:

rust
use carbon_core::{
    error::CarbonResult,
    instruction::InstructionProcessorInputType,
    processor::Processor,
};
use carbon_my_program_decoder::instructions::MyProgramInstruction;

struct MyProcessor;

impl Processor>
    for MyProcessor
{
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType,
    ) -> CarbonResult {
        log::info!("instruction: {:?}", input.decoded_instruction);
        Ok(())
    }
}

The same pattern works with any decoder and any datasource: import the decoder for the Solana program you care about, import the datasource that matches your latency or backfill requirements, then implement a processor for the typed data you want to handle.


Capabilities

  • Stream transactions, account updates, account deletions, and block metadata.
  • Decode instructions, nested CPIs, accounts, and emitted events into typed Rust structures.
  • Build real-time indexers, historical backfills, snapshot loaders, and hybrid data pipelines with the same processor model.
  • Combine multiple datasources and route updates with filters.
  • Generate decoder crates from Anchor or Codama IDLs.
  • Persist decoded data with typed Postgres rows or generic JSONB processors.
  • Expose indexed data through GraphQL using the built-in Juniper and Axum helpers.
  • Export pipeline metrics through logs or Prometheus.

Maintained Packages

Carbon includes maintained datasources and decoders so most indexers can start from existing building blocks instead of custom ingestion or decoding code.

Datasources

Datasource crates cover the common ways Solana data is consumed:

  • Geyser streams for low-latency production indexers.
  • Solana RPC for simple setups and public RPC compatibility.
  • Historical and snapshot sources for backfills, range replay, and loading current account state.
  • Hosted provider APIs (e.g. Helius) for provider-specific streaming and historical access.
  • Adapter datasources for bringing your own message stream.

See datasources/ for the full list.

Decoders

Decoder crates cover widely used Solana programs across core SPL programs, DeFi, NFTs, infrastructure, and more. They expose typed accounts, instructions, events, and optional serde, Postgres, and GraphQL integrations.

Use an existing decoder when one is available, or generate one from an Anchor or Codama IDL with carbon-cli parse.

See decoders/ for the full list.


Examples

The examples/ directory contains runnable indexers for the common ways Carbon is used: Geyser streaming, public RPC streaming, transaction backfills, account-state loading, validator snapshots, custom datasources, and Postgres-backed GraphQL APIs.

Each example is a workspace crate and can be run from the repository root:

bash
cargo run --release -p block-subscribe-rpc-carbon-example

Contributing

Contributions are welcome. See CONTRIBUTING.md for the development setup, local checks, and contribution guidelines.

License

Carbon is licensed under the MIT license.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言