← All tools

anchor

Popularity 85 Updated Development & Build

Solana Program Framework

homebrewauto-collected

Installation

Homebrew
brew install anchor

Install with Homebrew.

<div align="center" <img height="170x" src="https://pbs.twimg.com/media/FVUVaO9XEAAulvK?format=png&name=small" /

<h1Anchor</h1

<p <strongSolana Program Framework</strong </p

<p <a href="https://github.com/otter-sec/anchor/actions"<img alt="Build Status" src="https://github.com/otter-sec/anchor/actions/workflows/tests.yaml/badge.svg" /</a <a href="https://anchor-lang.com"<img alt="Tutorials" src="https://img.shields.io/badge/docs-tutorials-blueviolet" /</a <a href="https://discord.gg/NHHGSXAnXk"<img alt="Discord Chat" src="https://img.shields.io/discord/889577356681945098?color=blueviolet" /</a <a href="https://opensource.org/licenses/Apache-2.0"<img alt="License" src="https://img.shields.io/github/license/otter-sec/anchor?color=blueviolet" /</a </p </div

Anchor is a framework providing several convenient developer tools for writing Solana programs (sometimes called 'smart contracts').

  • Rust eDSL for writing Solana programs
  • IDL specification
  • TypeScript package for generating clients from IDL
  • CLI and workspace management for developing complete applications

Anchor is the most popular framework for Solana programs.

[!NOTE] If you're familiar with developing in Ethereum's Solidity, Truffle, web3.js, then using Anchor will be familiar. Although the DSL syntax and semantics are targeted at Solana, the high level flow of writing RPC request handlers, emitting an IDL, and generating clients from IDL is the same.

Getting Started

For a quickstart guide and in depth tutorials, see the Anchor book and the Anchor documentation.

To jump straight to examples, go here. For the latest Rust and TypeScript API documentation, see docs.rs and the typedoc.

Installation

The recommended way to install the Anchor CLI is with the Anchor Version Manager (AVM).

curl -sSfL https://raw.githubusercontent.com/otter-sec/anchor/master/avm/install | sh

The installer downloads the latest nightly AVM and Anchor CLI binaries, enables the nightly channel, and links the avm and anchor commands into ~/.cargo/bin when possible. After that, anchor will use the latest cached nightly build and periodically check for updates.

If you already have AVM installed, you can enable the nightly channel directly:

avm nightly

To leave nightly mode and return to normal AVM version resolution, run: