MCPcopy Index your code
hub / github.com/algorand/go-algorand

github.com/algorand/go-algorand @v4.7.3-stable

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.7.3-stable ↗ · + Follow
21,229 symbols 109,625 edges 1,851 files 8,253 documented · 39%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go-algorand

Branch Build Status
rel/stable Nightly Tests
rel/beta Nightly Tests
rel/nightly Nightly Tests

Algorand's official implementation in Go.

Algorand is a permissionless, pure proof-of-stake blockchain that delivers decentralization, scalability, security, and transaction finality.

Getting Started

Visit our developer website for the most up-to-date information about using and installing the Algorand platform.

Building from Source

Development is done using the Go Programming Language. The Go version is specified in the project's go.mod file. This document assumes you have a functioning environment set up. If you need assistance setting up an environment, please visit the official Go documentation website.

Linux / OSX

We currently strive to support Debian-based distributions, with Ubuntu 24.04 as our official release target. Building on Arch Linux also works well. Our core engineering team uses Linux and OSX, so both environments are well-supported for development.

OSX Only: Homebrew (brew) must be installed before continuing. Here are the installation requirements.

Initial Environment Setup

git clone https://github.com/algorand/go-algorand
cd go-algorand
./scripts/configure_dev.sh

At this point, you are ready to build go-algorand. We use make and have several targets to automate common tasks.

Build

make install

Test

# Unit tests
make test

# Integration tests
make integration

Style and Checks

make fmt
make lint
make fix
make vet

Alternatively, run:

make sanity

Running a Node

Once the software is built, you'll find binaries in ${GOPATH}/bin, and a data directory will be initialized at ~/.algorand. Start your node with:

${GOPATH}/bin/goal node start -d ~/.algorand

Use:

${GOPATH}/bin/carpenter -d ~/.algorand

to see activity. Refer to the developer website for instructions on using different tools.

Providing Your Own Data Directory

You can run a node out of other directories than ~/.algorand and join networks other than mainnet. Just make a new directory and copy the genesis.json file for the network into it. For example:

mkdir ~/testnet_data
cp installer/genesis/testnet/genesis.json ~/testnet_data/genesis.json
${GOPATH}/bin/goal node start -d ~/testnet_data

Genesis files for mainnet, testnet, and betanet can be found in installer/genesis/.

Contributing

Please refer to our CONTRIBUTING document.

Project Layout

go-algorand is organized into various subsystems and packages:

Core

Provides core functionality to the algod and kmd daemons, as well as other tools and commands:

  • crypto: Contains the cryptographic constructions used for hashing, signatures, and VRFs. It also includes Algorand-specific details about spending keys, protocol keys, one-time-use signing keys, and how they relate to each other.
  • config: Holds configuration parameters, including those used locally by the node and those that must be agreed upon by the protocol.
  • data: Defines various types used throughout the codebase.
  • basics: Holds basic types such as MicroAlgos, account data, and addresses.
  • account: Defines accounts, including "root" accounts (which can spend money) and "participation" accounts (which can participate in the agreement protocol).
  • transactions: Defines transactions that accounts can issue against the Algorand state, including standard payments and participation key registration transactions.
  • bookkeeping: Defines blocks, which are batches of transactions atomically committed to Algorand.
  • pools: Implements the transaction pool, holding transactions seen by a node in memory before they are proposed in a block.
  • committee: Implements the credentials that authenticate a participating account's membership in the agreement protocol.
  • ledger (README): Contains the Algorand Ledger state machine, which holds the sequence of blocks. The Ledger executes the state transitions resulting from applying these blocks. It answers queries on blocks (e.g., what transactions were in the last committed block?) and on accounts (e.g., what is my balance?).
  • protocol: Declares constants used to identify protocol versions, tags for routing network messages, and prefixes for domain separation of cryptographic inputs. It also implements the canonical encoder.
  • network: Contains the code for participating in a mesh network based on WebSockets. It maintains connections to some number of peers, (optionally) accepts connections from peers, sends point-to-point and broadcast messages, and receives messages, routing them to various handler code (e.g., agreement/gossip/network.go registers three handlers).
  • rpcs: Contains the HTTP RPCs used by algod processes to query one another.
  • agreement (README): Contains the agreement service, which implements Algorand's Byzantine Agreement protocol. This protocol allows participating accounts to quickly confirm blocks in a fork-safe manner, provided that sufficient account stake is correctly executing the protocol.
  • node: Integrates the components above and handles initialization and shutdown. It provides queries into these components.

Daemon

Contains the two daemons that provide Algorand clients with services:

  • daemon/algod: Holds the algod daemon, which implements a participating node. algod allows a node to participate in the agreement protocol, submit and confirm transactions, and view the state of the Algorand Ledger.
  • daemon/algod/api (README): The REST interface used for interactions with algod.
  • daemon/kmd (README): Holds the kmd daemon, which allows a node to sign transactions. Since kmd is separate from algod, it enables a user to sign transactions on an air-gapped computer.

Interfacing

Enables developers to interface with the Algorand system:

  • cmd: Contains the primary commands defining entry points into the system.
  • libgoal: Exports a Go interface useful for developers of Algorand clients.
  • tools (README): Various tools and utilities that don’t have a better place to go.
  • tools/debug: Holds secondary commands that assist developers during debugging.
  • tools/misc (README): Small tools that are handy in a pinch.

Deployment

Helps Algorand developers deploy networks of their own:

  • nodecontrol
  • docker
  • netdeploy

Utilities

Provides utilities for the various components:

  • logging: A wrapper around logrus.
  • util: Contains a variety of utilities, including a codec, a SQLite wrapper, a goroutine pool, a timer interface, node metrics, and more.

Test

  • test (README): Contains end-to-end tests and utilities for the above components.

License

License: AGPL v3

Please see the COPYING_FAQ for details on how to apply our license.

Copyright (C) 2019-2026, Algorand Foundation Ltd.

Extension points exported contracts — how you extend this code

BlockHeaderFetcher (Interface)
BlockHeaderFetcher captures the aspects of the Ledger that is used to fetch block headers [26 implementers]
stateproof/abstractions.go
Hashable (Interface)
Hashable is an interface implemented by an object that can be represented with a sequence of bytes to be hashed or signe [39 …
crypto/util.go
BlockValidator (Interface)
this file holds abstractions that agreement depends on An BlockValidator validates that a given Block may correctly be a [14 …
agreement/abstractions.go
DownstreamFilter (Interface)
DownstreamFilter is the network filter downsteam filter interface [18 implementers]
agreement/fuzzer/filter_test.go
DisconnectablePeer (Interface)
DisconnectablePeer is a Peer with a long-living connection to a network that can be disconnected [7 implementers]
network/gossipNode.go
SolicitedTxHandler (Interface)
SolicitedTxHandler handles messages received through channels other than the gossip network. It therefore circumvents th [9 …
data/txHandler.go
FieldSpec (Interface)
go:generate go tool -modfile=../../../tool.mod stringer -type=TxnField,GlobalField,AssetParamsField,AppParamsField,AcctP [14 …
data/transactions/logic/fields.go
LedgerForSPBuilder (Interface)
LedgerForSPBuilder captures the functionality needed for the creation of the cryptographic state proof builder. [7 implementers]
ledger/ledgercore/votersForRound.go

Core symbols most depended-on inside this repo

Equal
called by 4508
crypto/multisig.go
PartitionTest
called by 2887
test/partitiontest/filtering.go
Errorf
called by 1939
logging/log.go
String
called by 1064
agreement/events.go
Errorf
called by 915
data/pools/transactionPool_test.go
Equal
called by 796
data/basics/teal.go
Error
called by 783
logging/log.go
Run
called by 657
crypto/batchverifier_test.go

Shape

Function 9,719
Method 8,910
Struct 1,902
TypeAlias 279
Interface 249
Class 114
FuncType 51
Enum 5

Languages

Go90%
C6%
C++2%
Python2%
Java1%
TypeScript1%

Modules by API surface

agreement/msgp_gen.go408 symbols
data/transactions/logic/eval.go346 symbols
crypto/msgp_gen.go288 symbols
agreement/msgp_gen_test.go220 symbols
data/transactions/msgp_gen.go192 symbols
data/transactions/logic/eval_test.go186 symbols
data/basics/msgp_gen.go184 symbols
crypto/msgp_gen_test.go165 symbols
network/wsNetwork_test.go163 symbols
data/transactions/logic/fields.go158 symbols
data/transactions/logic/assembler.go157 symbols
ledger/store/trackerdb/interface.go131 symbols

For agents

$ claude mcp add go-algorand \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page