OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Anchor Go

Anchor Go is an open-source Go command-line tool that reads Anchor IDL files for Solana programs and generates Go client code for interacting with those programs and their data structures.

Independent OpenViST project profile, based on linked sources.

Anchor Go — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a Go project needs client code for a Solana program built with Anchor and the program's IDL is available in a supported format.

Who it is for

  • Go developers building applications or services that interact with Anchor-based Solana programs.
  • Teams that have a program IDL and need Go representations of its instructions and data structures.

Documented uses

  • Generate Go client code from an Anchor IDL.
  • Create Go representations of program instructions, accounts, events, types, tuple types and constants.
  • Use generated clients in Go services that interact with Solana programs.
Before you choose

Requirements & limits

The code is available from a public GitHub repository identified as MIT-licensed. Installation and use are documented through the Go CLI.

  • The IDL must use Anchor format v0.30.0 or later; older files need conversion.
  • The documented generated coverage includes instructions, accounts, events, types, tuple types and constants, but not error parsing.
  • The workflow requires the program ID as well as the IDL and output directory.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Generate Go code from an Anchor IDL

Install Anchor Go and generate client code using an IDL file and program ID.

Before you start

  • Go installation, for the documented go install command.
  • An Anchor IDL in format v0.30.0 or later.
  • The IDL file path, desired output directory and program ID.

Steps

  1. Install with the command below.

    Documented command
    go install github.com/gagliardetto/anchor-go@latest
  2. Run anchor-go --idl /path/to/idl.json --output ./generated --program-id 0123456789abcdef0123456789abcdef0123456789, substituting the relevant file, directory and program ID.

Expected outcome

Generated Go client code for the Solana program, covering instructions, accounts, events, types, tuple types and constants.

Guide limitations

  • The documented tool version supports Anchor IDL format v0.30.0 and later.
  • Error parsing is listed as unsupported.
  • Older IDLs must be converted to the supported format using Anchor's anchor idl convert command.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
8 October 2026
Original website title
gagliardetto/anchor-go · Official homepage title · retained in its source language