• Stars
    star
    2,109
  • Rank 21,878 (Top 0.5 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

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

Repository Details

Go implementation of an Avalanche node.

Node implementation for the Avalanche network - a blockchains platform with high throughput, and blazing fast transactions.

Installation

Avalanche is an incredibly lightweight protocol, so the minimum computer requirements are quite modest. Note that as network usage increases, hardware requirements may change.

The minimum recommended hardware specification for nodes connected to Mainnet is:

  • CPU: Equivalent of 8 AWS vCPU
  • RAM: 16 GiB
  • Storage: 1 TiB
  • OS: Ubuntu 20.04/22.04 or macOS >= 12
  • Network: Reliable IPv4 or IPv6 network connection, with an open public port.

If you plan to build AvalancheGo from source, you will also need the following software:

  • Go version >= 1.19.12
  • gcc
  • g++

Building From Source

Clone The Repository

Clone the AvalancheGo repository:

git clone [email protected]:ava-labs/avalanchego.git
cd avalanchego

This will clone and checkout the master branch.

Building AvalancheGo

Build AvalancheGo by running the build script:

./scripts/build.sh

The avalanchego binary is now in the build directory. To run:

./build/avalanchego

Binary Repository

Install AvalancheGo using an apt repository.

Adding the APT Repository

If you already have the APT repository added, you do not need to add it again.

To add the repository on Ubuntu, run:

sudo su -
wget -qO - https://downloads.avax.network/avalanchego.gpg.key | tee /etc/apt/trusted.gpg.d/avalanchego.asc
source /etc/os-release && echo "deb https://downloads.avax.network/apt $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/avalanche.list
exit

Installing the Latest Version

After adding the APT repository, install avalanchego by running:

sudo apt update
sudo apt install avalanchego

Binary Install

Download the latest build for your operating system and architecture.

The Avalanche binary to be executed is named avalanchego.

Docker Install

Make sure Docker is installed on the machine - so commands like docker run etc. are available.

Building the Docker image of latest avalanchego branch can be done by running:

./scripts/build_image.sh

To check the built image, run:

docker image ls

The image should be tagged as avaplatform/avalanchego:xxxxxxxx, where xxxxxxxx is the shortened commit of the Avalanche source it was built from. To run the Avalanche node, run:

docker run -ti -p 9650:9650 -p 9651:9651 avaplatform/avalanchego:xxxxxxxx /avalanchego/build/avalanchego

Running Avalanche

Connecting to Mainnet

To connect to the Avalanche Mainnet, run:

./build/avalanchego

You should see some pretty ASCII art and log messages.

You can use Ctrl+C to kill the node.

Connecting to Fuji

To connect to the Fuji Testnet, run:

./build/avalanchego --network-id=fuji

Creating a Local Testnet

See this tutorial.

Bootstrapping

A node needs to catch up to the latest network state before it can participate in consensus and serve API calls. This process (called bootstrapping) currently takes several days for a new node connected to Mainnet.

A node will not report healthy until it is done bootstrapping.

Improvements that reduce the amount of time it takes to bootstrap are under development.

The bottleneck during bootstrapping is typically database IO. Using a more powerful CPU or increasing the database IOPS on the computer running a node will decrease the amount of time bootstrapping takes.

Generating Code

AvalancheGo uses multiple tools to generate efficient and boilerplate code.

Running protobuf codegen

To regenerate the protobuf go code, run scripts/protobuf_codegen.sh from the root of the repo.

This should only be necessary when upgrading protobuf versions or modifying .proto definition files.

To use this script, you must have buf (v1.26.1), protoc-gen-go (v1.30.0) and protoc-gen-go-grpc (v1.3.0) installed.

To install the buf dependencies:

go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]

If you have not already, you may need to add $GOPATH/bin to your $PATH:

export PATH="$PATH:$(go env GOPATH)/bin"

If you extract buf to ~/software/buf/bin, the following should work:

export PATH=$PATH:~/software/buf/bin/:~/go/bin
go get google.golang.org/protobuf/cmd/protoc-gen-go
go get google.golang.org/protobuf/cmd/protoc-gen-go-grpc
scripts/protobuf_codegen.sh

For more information, refer to the GRPC Golang Quick Start Guide.

Running protobuf codegen from docker

docker build -t avalanche:protobuf_codegen -f api/Dockerfile.buf .
docker run -t -i -v $(pwd):/opt/avalanche -w/opt/avalanche avalanche:protobuf_codegen bash -c "scripts/protobuf_codegen.sh"

Running mock codegen

To regenerate the gomock code, run scripts/mock.gen.sh from the root of the repo.

This should only be necessary when modifying exported interfaces or after modifying scripts/mock.mockgen.txt.

Versioning

Version Semantics

AvalancheGo is first and foremost a client for the Avalanche network. The versioning of AvalancheGo follows that of the Avalanche network.

  • v0.x.x indicates a development network version.
  • v1.x.x indicates a production network version.
  • vx.[Upgrade].x indicates the number of network upgrades that have occurred.
  • vx.x.[Patch] indicates the number of client upgrades that have occurred since the last network upgrade.

Library Compatibility Guarantees

Because AvalancheGo's version denotes the network version, it is expected that interfaces exported by AvalancheGo's packages may change in Patch version updates.

API Compatibility Guarantees

APIs exposed when running AvalancheGo will maintain backwards compatibility, unless the functionality is explicitly deprecated and announced when removed.

Supported Platforms

AvalancheGo can run on different platforms, with different support tiers:

  • Tier 1: Fully supported by the maintainers, guaranteed to pass all tests including e2e and stress tests.
  • Tier 2: Passes all unit and integration tests but not necessarily e2e tests.
  • Tier 3: Builds but lightly tested (or not), considered experimental.
  • Not supported: May not build and not tested, considered unsafe. To be supported in the future.

The following table lists currently supported platforms and their corresponding AvalancheGo support tiers:

Architecture Operating system Support tier
amd64 Linux 1
arm64 Linux 2
amd64 Darwin 2
amd64 Windows 3
arm Linux Not supported
i386 Linux Not supported
arm64 Darwin Not supported

To officially support a new platform, one must satisfy the following requirements:

AvalancheGo continuous integration Tier 1 Tier 2 Tier 3
Build passes ✓ ✓ ✓
Unit and integration tests pass ✓ ✓
End-to-end and stress tests pass ✓

Security Bugs

We and our community welcome responsible disclosures.

Please refer to our Security Policy and Security Advisories.

More Repositories

1

avalanche-faucet

Avalanche Faucet for Fuji Network and Subnets.
TypeScript
467
star
2

avalanchejs

The Avalanche Platform JavaScript Library
TypeScript
319
star
3

avalanche-smart-contract-quickstart

The easiest way to build smart contracts on Avalanche.
Solidity
250
star
4

subnet-evm

Launch your own EVM as an Avalanche Subnet
Go
239
star
5

avalanche-wallet

The Avalanche web wallet
Vue
229
star
6

hypersdk

Opinionated Framework for Building Hyper-Scalable Blockchains on Avalanche
Go
193
star
7

coreth

Code and wrapper to extract Ethereum blockchain functionalities without network/consensus, for building custom blockchain services.
Go
180
star
8

mastering-avalanche

Mastering Avalanche 1st Edition - The Internet of Finance
176
star
9

avalanche-docs

Protocol documentation for the Avalanche network.
MDX
161
star
10

firewood

Compaction-Less Database Optimized for Efficiently Storing Recent Merkleized Blockchain State
Rust
109
star
11

avalanche-cli

Go
100
star
12

spacesvm

Go
85
star
13

avalanche-explorer

The Vue frontend for the Avalanche blockchain.
Vue
82
star
14

avalanche-network-runner

Tool to run and interact with an Avalanche network locally
Go
81
star
15

avash

Avash - The Avalanche Shell Client
Go
72
star
16

ortelius

State archival and indexer for the Avalanche network. Used in the Avalanche Explorer.
Go
59
star
17

subnet-cli

Go
58
star
18

avalanche-rs

Avalanche APIs/VM SDK in Rust
Rust
45
star
19

avalanche-wallet-sdk

A Typescript library to create and manage wallets on the Avalanche network.
TypeScript
39
star
20

avalanche-ops

operation toolkit for Avalanche nodes
Rust
38
star
21

wrapped-assets

Smart Contract for Wrapped AVAX
Solidity
38
star
22

ecosystem-projects

JavaScript
33
star
23

avalanche-types-rs

Avalanche primitive types in Rust (experimental)
Rust
32
star
24

avalanche-faucet-legacy

A frontend Vue application for the Avalanche Faucet
TypeScript
30
star
25

avalanche-rosetta

Rosetta server for Avalanche (C-Chain and P-Chain)
Go
30
star
26

xsvm

Example Virtual Machine supporting Subnet Messaging on the Avalanche Network
Go
29
star
27

ava-sim

Go
28
star
28

avalanche-bridge-resources

Token List for the Avalanche Bridge
Solidity
26
star
29

teleporter

EVM cross-chain messaging protocol built on top of Avalanche Warp Messaging
Solidity
23
star
30

timestampvm

timestampvm implementation as rpc-plugin
Go
23
star
31

bridge-tokens

Python
23
star
32

precompile-evm

A new repository for Subnet-EVM Stateful Precompiles
Shell
20
star
33

blobvm

Go
19
star
34

timestampvm-rs

Timestamp VM in Rust
Rust
18
star
35

avax-js-cli-tools

A collection of helpful scripts for the Avalanche network.
JavaScript
17
star
36

spacesvm-js

TypeScript
17
star
37

avalanche-interchain-token-transfer

Cross-chain token transfer built on top of Teleporter
Solidity
13
star
38

indexvm

The Context Layer of the Decentralized Web
Go
11
star
39

avalanche-monitoring

Monitoring tooling for Avalanche nodes
Shell
10
star
40

avalanche-quicksign

A very simple webpage that signs a string with a private key and prompts the user to email it. Used to verify users on the test net.
Vue
10
star
41

mnemonic-shamir-secret-sharing-cli

C++
10
star
42

ledger-avalanche

Rust
9
star
43

audits

Security audits for the Avalanche platform
9
star
44

awm-relayer

Service for relaying Avalanche Warp Messages between Subnets
Go
9
star
45

apm

Plugin manager for Avalanche
Go
8
star
46

avalanche-dapp-sdks

Working example of a dapp working with core extension
TypeScript
8
star
47

avalanche-network-runner-sdk-rs

avalanche-network-runner-sdk-rs
Rust
8
star
48

avalanchetipbot

Avalanche Tip Bot for telegram, twitter and discord.
JavaScript
7
star
49

core-mobile

TypeScript
7
star
50

chainsafe-scripts

Scripts for chainsafe analysis
Python
6
star
51

avalanche-evm-gasless-transaction

Rust
6
star
52

public-facing-docs

Repo of public docs
6
star
53

spacesvm-rs

Spaces VM in Rust
Rust
6
star
54

avalanche-network-runner-sdk

Go
5
star
55

avalanche-network-runner-postman-collection

A postman colllection to interact with the Avalanche Network Runner
4
star
56

avalanche-plugins-core

Core plugins for Avalanche
4
star
57

vue-components

A collection of Vue based components used across our application frontends.
Vue
4
star
58

firewood-mit

Rust
4
star
59

avalanche-ledger-go

Shell
3
star
60

avalanchego-kurtosis

Run AvalancheGo tests in the Kurtosis framework
Go
3
star
61

open-defi-hackathon

3
star
62

gnosis-subnet

Helper repo for deploying gnosis safe contracts on Avalanche subnets
Shell
3
star
63

cargo-workspace-version

Cargo plugin to check and/or update all local package versions in a workspace
Rust
3
star
64

spacesvm-postman-collection

Postman collection for the SpacesVM
2
star
65

avalanchejs-docs

Documentation for AvalancheJS
2
star
66

subnet-assets

JavaScript
2
star
67

ip-manager

IP manager
Rust
2
star
68

avalanche-telemetry

Avalanche node telemetry agent (supports CloudWatch, DataDog)
Rust
2
star
69

qevm

Rust
2
star
70

public-avalanche-sdks

Public SDKs for interfacing with Avalanche
TypeScript
2
star
71

avalanche-tooling-sdk-go

Go
2
star
72

avalanche-installer

Avalanche installer
Rust
1
star
73

btcb-por-workshop

Demo contracts for interacting with the BTC.b Proof-of-Reserves on Fuji Testnet
Shell
1
star
74

avalanchego-operator

Go
1
star
75

avalanche-hackathon

Solidity
1
star
76

homebrew-avalanchego

Homebrew formula for distribution of public avalanche binaries to MacOS
Ruby
1
star