Anchor: Solana Program Development Framework
A Rust-based framework for building Solana programs with IDL generation and TypeScript client support.
Learn more about Anchor
Anchor is a development framework for building programs on the Solana blockchain. It provides a Rust embedded domain-specific language (eDSL) that abstracts low-level Solana program development complexities. The framework generates Interface Description Language (IDL) specifications from Rust code and includes tooling for TypeScript client generation. Anchor includes CLI tools for workspace management and is commonly used for developing decentralized applications on Solana.
Rust eDSL
Provides high-level Rust abstractions for Solana program development with account validation and serialization handling.
IDL Generation
Automatically generates interface specifications from Rust code, enabling type-safe client generation across multiple languages.
Complete Toolchain
Includes CLI tools, workspace management, and both Rust and TypeScript client libraries for full-stack development.
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod my_program {
use super::*;
pub fn initialize(ctx: Context<Initialize>, data: u64) -> Result<()> {
let my_account = &mut ctx.accounts.my_account;
my_account.data = data;
my_account.authority = ctx.accounts.user.key();
Ok(())
}
pub fn update(ctx: Context<Update>, new_data: u64) -> Result<()> {
let my_account = &mut ctx.accounts.my_account;
my_account.data = new_data;
Ok(())
}
}
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(
init,
payer = user,
space = 8 + 8 + 32
)]
pub my_account: Account<'info, MyAccount>,
#[account(mut)]
pub user: Signer<'info>,
pub system_program: Program<'info, System>,
}
#[derive(Accounts)]
pub struct Update<'info> {
#[account(
mut,
has_one = authority
)]
pub my_account: Account<'info, MyAccount>,
pub authority: Signer<'info>,
}
#[account]
pub struct MyAccount {
pub data: u64,
pub authority: Pubkey,
}See how people are using Anchor
Top in Crypto
Related Repositories
Discover similar tools and frameworks used by developers
NEAR Core
Reference implementation of NEAR Protocol blockchain, providing infrastructure for smart contracts and applications.
Aave V3 Core
Smart contracts for Aave Protocol V3, a decentralized liquidity market for lending and borrowing cryptocurrencies.
BitcoinJS
A TypeScript-based Bitcoin library providing cryptographic functions and transaction handling for Node.js and browsers.
Hyperledger Fabric
Modular enterprise blockchain framework with permissioned networks, pluggable consensus, and privacy controls.
Solmate
A collection of gas-optimized Solidity contracts including ERC token implementations and utility libraries.
Related Reading
Guides and comparisons from the Greptile content library
10 Powerful Code Quality Tools That Catch Bugs Before Deployment
We tested 10 code quality tools that catch bugs before production. Detailed comparison with real-world examples, pricing, and ROI analysis for dev teams.
Best AI Code Review Tools for GitHub
Top-rated AI code review tools for GitHub teams in 2025. Compare features, pricing, and accuracy to find the perfect fit for faster PR reviews and bulletproof code quality.
The 7 Best AI Coding Tools for Complex Codebases
The best AI coding tools for complex codebases, ranked on accuracy, suggestion quality, and full-codebase context. See which ones you can actually trust.
How to ACTUALLY Think About Code Reviews: The 3-Layer Checklist
A code review checklist and best practices organized around three layers — Mechanical, Structural, and Narrative — that help any team improve code quality without slowing reviews down.