• Stars
    star
    1,328
  • Rank 35,391 (Top 0.7 %)
  • Language
    Go
  • License
    Other
  • Created over 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Algorand's official implementation in Go.
rel/stable
CircleCI
rel/beta
CircleCI
rel/nightly
CircleCI

go-algorand

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

Our developer website has 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 version of go is specified in the project's go.mod file. This document assumes that you have a functioning environment setup. 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 20.04 being our official release target. Building on Arch Linux works as 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
./scripts/buildtools/install_buildtools.sh

At this point, you are ready to build go-algorand. We use make and have a number of 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

or alternatively

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 how to use the 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 into it the genesis.json file for the network. 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 split into various subsystems containing varius packages.

Core

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

  • crypto contains the cryptographic constructions we're using for hashing, signatures, and VRFs. There are also some Algorand-specific details here about spending keys, protocols keys, one-time-use signing keys, and how they relate to each other.
  • config holds configuration parameters. These include parameters used locally by the node as well as parameters that must be agreed upon by the protocol.
  • data defines various types used throughout the codebase.
    • basics hold 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 define transactions that accounts can issue against the Algorand state. These include standard payments and also participation key registration transactions.
    • bookkeeping defines blocks, which are batches of transactions atomically committed to Algorand.
    • pools implement the transaction pool. The transaction pool holds 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 that result 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. Maintains connection 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 which 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) is the REST interface used for interactions with algod.
  • daemon/kmd (README) holds the kmd daemon. This daemon allows a node to sign transactions. Because kmd is separate from algod, kmd allows a user to sign transactions on an air-gapped computer.

Interfacing

Allows developers to interface with the Algorand system:

  • cmd holds the primary commands defining entry points into the system.
    • cmd/catchupsrv (README) is a tool to assist with processing historic blocks on a new node.
  • libgoal exports a Go interface useful for developers of Algorand clients.
  • tools (README) various tools and utilities without a better place to go.
  • tools/debug holds secondary commands which assist developers during debugging.
  • tools/misc (README) small tools that are sometimes handy in a pinch.

Deployment

Help Algorand developers deploy networks of their own:

  • nodecontrol
  • docker
  • commandandcontrol (README) is a tool to automate a network of algod instances.
  • components
  • netdeploy

Utilities

Provides utilities for the various components:

  • logging is 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 about how to apply our license.

Copyright (C) 2019-2023, Algorand Inc.

More Repositories

1

js-algorand-sdk

The official JavaScript SDK for Algorand.
TypeScript
280
star
2

pyteal

Algorand Smart Contracts in Python
Python
280
star
3

py-algorand-sdk

Algorand Python SDK
Python
256
star
4

sandbox

Algorand node sandbox
Shell
235
star
5

go-algorand-sdk

Algorand Golang SDK
Go
184
star
6

indexer

searchable history and current state
Go
115
star
7

smart-contracts

Example stateful and stateless smart contracts.
JavaScript
69
star
8

java-algorand-sdk

Algorand SDK for Java7+ to interact with the Algorand network
Java
66
star
9

auction-demo

An example smart contract NFT auction on Algorand
Python
57
star
10

bls_sigs_ref

Algorand's reference implementation of bls signature scheme
Python
47
star
11

pointproofs

Rust
46
star
12

go-algorand-doc

Documentation for Algorand's Go implementation
Shell
39
star
13

conduit

Algorand's data pipeline framework.
Go
35
star
14

pyteal-utils

Python
29
star
15

node-ui

Terminal UI for remote Algorand node management.
Go
27
star
16

ledger-app-algorand

C
23
star
17

algorand-sdk-testing

Testing framework for Algorand SDKs
Gherkin
20
star
18

pairing-plus

This is a fork of pairing library with additional efficiency functionality improvement.
Rust
20
star
19

falcon

C
20
star
20

graviton

πŸ§‘β€πŸ”¬ verify your TEAL program by experiment and observation
Jupyter Notebook
18
star
21

pixel

Algorand's implementation of pixel consensus signature
Rust
18
star
22

vrf

Some tools for debugging/testing the VRF
C
13
star
23

tealviewer

JavaScript
11
star
24

reach-auction

Getting Started With Reach
JavaScript
11
star
25

mule

General automation framework
Python
11
star
26

msgp

Go
10
star
27

light-client-poc

Go
9
star
28

code-samples

Code samples tied to tutorials and solutions.
JavaScript
8
star
29

go-sumhash

Go
8
star
30

generator

OpenAPI parser/generator.
Java
7
star
31

symteal

Symteal is an automated verification framework for Algorand
Racket
6
star
32

go-stateproof-verification

Go
6
star
33

avm-abi

ARC-4 ABI Reference Implementation
Go
6
star
34

pointproofs-paramgen

Rust
5
star
35

pixel_param

A rust implementation for parameter generations of Pixel signature scheme
Rust
5
star
36

avm-debugger

Debug Adapter Protocol Debugger for the Algorand Virtual Machine
JavaScript
5
star
37

messagepack-debugger

Visually compare MessagePack objects to assist with debugging.
Kotlin
4
star
38

DerivhackExamples

Examples for the 2019 Derivhack Hackathon
Java
4
star
39

app-service

Java
4
star
40

graphtrace

System for tracing timing and propagation of messages across a mesh network
Go
4
star
41

wallet_addresses

Algorand Inc.'s Wallet Addresses: https://github.com/algorand/wallet_addresses
3
star
42

stateful-teal-auction-demo

A demo of an auction on stateful TEAL.
Shell
3
star
43

conduit-plugin-template

Get started with Algorand streaming APIs with Conduit plugin templates project.
Go
3
star
44

tealsign-demo

Shell
2
star
45

conduit-cockroachdb

Experimental CockroachDB exporter for Conduit.
Go
2
star
46

aardvark-prototype

Aardvark evaluation artifact
Go
2
star
47

tealfuzz

Go
2
star
48

sortition

C++
1
star
49

ledgerfuzz

C
1
star
50

Derivhack-Demo

1
star
51

walletconnect-automation

Automation for deploying walletconnect to eks
Shell
1
star
52

py-exebot

Bot for executing code off-chain.
1
star