Skip to content
Algorand's official implementation in Go.
Branch: master
Clone or download
tsachiherman and Karmastic [GOAL2-877] Fix data race in asyncVoteVerifier during shutdown (#171)
* Fix bug.

* unwrap anonymous function.

* add in-code comments.
Latest commit a051ff4 Jul 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Changetemplate (#76) Jun 25, 2019
agreement [GOAL2-877] Fix data race in asyncVoteVerifier during shutdown (#171) Jul 19, 2019
auction [GOAL2-664] Add optional minTxnFee to api spec (#145) Jul 12, 2019
catchup Catchup: avoid retrying unless previous block was retrieved. (#31) Jun 17, 2019
cmd [GOAL2-770] Print registration information in `goal account listpartk… Jul 18, 2019
commandandcontrol Implement Algorand. Jun 11, 2019
components Implement Algorand. Jun 11, 2019
config Eric/goal2 569 multiple srv servers (#121) Jul 19, 2019
crypto -- Fixes issue #120 (#122) Jul 8, 2019
daemon [GOAL2-770] Expose on-chain account participation information API (#163) Jul 18, 2019
data [GOAL2-770] refactor `Node.GetBalanceAndStatus` (#155) Jul 16, 2019
debug Support streaming in the coroner debug tool. (#33) Jun 14, 2019
docker Updating the docker file to work (#53) Jun 20, 2019
docs Implement Algorand. Jun 11, 2019
gen Changes for issue with ChecksumAddress (#102) Jul 8, 2019
installer Group mode cleanup (#169) Jul 19, 2019
ledger [GOAL2-770] refactor `Node.GetBalanceAndStatus` (#155) Jul 16, 2019
libgoal [GOAL2-664] Add optional minTxnFee to api spec (#145) Jul 12, 2019
logging
netdeploy GOAL2-653 deprecate IsRelay field in NodeConfig (#152) Jul 15, 2019
network Eric/goal2 569 multiple srv servers (#121) Jul 19, 2019
node [GOAL2-770] refactor `Node.GetBalanceAndStatus` (#155) Jul 16, 2019
nodecontrol Implement Algorand. Jun 11, 2019
protocol [GOAL2-460] Avoid block decoding/encoding during ledger service (#99) Jun 27, 2019
rpcs Add User-Agent header. (#160) Jul 18, 2019
scripts Group mode cleanup (#169) Jul 19, 2019
shared Changes for issue with ChecksumAddress (#102) Jul 8, 2019
test [GOAL2-770] Expose on-chain account participation information API (#163) Jul 18, 2019
tools/network
util fix TestDBConcurrencyRW (#170) Jul 19, 2019
vendor Graceful shutdown (#108) Jul 8, 2019
wallet Implement Algorand. Jun 11, 2019
.gitattributes Add .gitattributes file (#29) Jun 14, 2019
.gitignore
.travis.yml Move travis to 18.04 (#104) Jun 29, 2019
CONTRIBUTING.md Add GitHub templates. (#48) Jun 18, 2019
COPYING Implement Algorand. Jun 11, 2019
COPYING_FAQ Update COPYING_FAQ to add contact emails. (#9) Jun 12, 2019
Gopkg.lock Graceful shutdown (#108) Jul 8, 2019
Gopkg.toml cleanup Gopkg.toml based on suggestions from "dep ensure" (#4) Jun 13, 2019
Makefile [GOAL2-844] Re-enable go-swagger in build (#130) Jul 9, 2019
README.md Specify what version of go we use in the README. (#17) Jun 13, 2019

README.md

Build Status

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 version 1.12.x, and 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 18.04 being our official release target. Our core engineering team uses Linux and OSX, so both environments are well supported for development.

Initial environment setup:

mkdir -p ${GOPATH}/src/github.com/algorand
cd ${GOPATH}/src/github.com/algorand
git clone https://github.com/algorand/go-algorand
cd go-algorand
sh ./scripts/configure_dev.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.

Contributing (Code, Documentation, Bugs, Etc)

Please refer to our CONTRIBUTING document.

Project Layout

go-algorand is split into various subpackages.

The following packages provide 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 which 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. These include standard payments and also participation key registration transactions.
    • bookkeeping defines blocks, which are batches of transactions atomically committed to Algorand.
    • pools implements 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 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 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 defines 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/kmd 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.

The following packages allow developers to interface with the Algorand system:

  • cmd holds the primary commands defining entry points into the system.
  • libgoal exports a Go interface useful for developers of Algorand clients.
  • debug holds secondary commands which assist developers during debugging.

The auction package implements the Algorand auctions.

The following packages contain tools to help Algorand developers deploy networks of their own:

  • nodecontrol
  • tools
  • docker
  • commandandcontrol
  • components
  • netdeploy

A number of packages provide 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 contains end-to-end tests for the above components.

License

License: AGPL v3

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

Copyright (C) 2019, Algorand Inc

You can’t perform that action at this time.