Anchor-by-example is an open source repository containing serveral Solana program example written in Anchor.

Oficial Documentation

A CLI is provided to support building and managing an Anchor workspace.


Step-by-step guide to setting up your system and installing Anchor

Hello World

This program will log our hello world message into program's on-chain transaction log. We will simply use msg!() macro for logging the hello world.

On-Chain Voting

In this program, we are going to build a decentralized on-chain voting system on solana. Where users can vote on our favourite GM and GN. Let's see who will win 🚀.

What is Anchor

Anchor is a framework for quickly building secure Solana programs.

With Anchor you can build programs quickly because it writes various boilerplate for you such as (de)serialization of accounts and instruction data.

You can build secure programs more easily because Anchor handles certain security checks for you. On top of that, it allows you to succinctly define additional checks and keep them separate from your business logic.

Both of these aspects mean that instead of working on the tedious parts of raw Solana programs, you can spend more time working on what matters most, your product.


Stay up to date on Twitter

Join the community

Discord Invitation