How solana-foundation/solana-attestation-service works
Project type and purpose
• This is a blockchain-oriented service built on Solana: a Solana smart-contract (“program”) that implements an attestation service, plus all the associated tooling to generate IDL and client SDKs.
• Key purpose:
• program/: the on-chain Rust BPF program that defines state, instruction handlers, errors, events
• idl/: the JSON interface description of that program
• clients/: generated Rust and TypeScript SDKs that use the IDL to call the on-chain program
• integration_tests/: end-to-end tests that deploy the program and drive it via the SDK
File structure
• Top-level
• program/: main on-chain Rust code (entrypoint, instructions.rs, processor modules, state definitions)
• core/ & cereal_macro/: shared Rust crates for data types, serialization macros, helpers used by program and client codegen
• idl/: JSON file produced by Shank
• clients/: two subdirectories (rust and typescript) containing generated SDKs under src/generated
• scripts/: JavaScript scripts that invoke Shank and client generation
• integration_tests/: Rust tests that spin up a local cluster or test harness, invoke program instructions, assert behavior
• package.json & pnpm-lock.yaml: Node toolchain for TS client and scripts
• Cargo.toml(s): Rust workspace and individual crate definitions
• Patterns
• Macro-driven codegen (cereal_macro, Shank) to produce IDL and typed client code
• Clear separation: on-chain program vs off-chain client code vs IDL vs tests
README for additional insights
• Describes how to:
• build the on-chain program (cargo-build-sbf)
• run integration tests (which reuse the built BPF artifact)
• generate IDL via Shank CLI or pnpm script
• generate clients via pnpm script, consuming the IDL