github.com/ava-labs/avalanchego@v1.11.11/README.md (about) 1 <div align="center"> 2 <img src="resources/AvalancheLogoRed.png?raw=true"> 3 </div> 4 5 --- 6 7 Node implementation for the [Avalanche](https://avax.network) network - 8 a blockchains platform with high throughput, and blazing fast transactions. 9 10 ## Installation 11 12 Avalanche is an incredibly lightweight protocol, so the minimum computer requirements are quite modest. 13 Note that as network usage increases, hardware requirements may change. 14 15 The minimum recommended hardware specification for nodes connected to Mainnet is: 16 17 - CPU: Equivalent of 8 AWS vCPU 18 - RAM: 16 GiB 19 - Storage: 1 TiB 20 - Nodes running for very long periods of time or nodes with custom configurations may observe higher storage requirements. 21 - OS: Ubuntu 20.04/22.04 or macOS >= 12 22 - Network: Reliable IPv4 or IPv6 network connection, with an open public port. 23 24 If you plan to build AvalancheGo from source, you will also need the following software: 25 26 - [Go](https://golang.org/doc/install) version >= 1.21.12 27 - [gcc](https://gcc.gnu.org/) 28 - g++ 29 30 ### Building From Source 31 32 #### Clone The Repository 33 34 Clone the AvalancheGo repository: 35 36 ```sh 37 git clone git@github.com:ava-labs/avalanchego.git 38 cd avalanchego 39 ``` 40 41 This will clone and checkout the `master` branch. 42 43 #### Building AvalancheGo 44 45 Build AvalancheGo by running the build script: 46 47 ```sh 48 ./scripts/build.sh 49 ``` 50 51 The `avalanchego` binary is now in the `build` directory. To run: 52 53 ```sh 54 ./build/avalanchego 55 ``` 56 57 ### Binary Repository 58 59 Install AvalancheGo using an `apt` repository. 60 61 #### Adding the APT Repository 62 63 If you already have the APT repository added, you do not need to add it again. 64 65 To add the repository on Ubuntu, run: 66 67 ```sh 68 sudo su - 69 wget -qO - https://downloads.avax.network/avalanchego.gpg.key | tee /etc/apt/trusted.gpg.d/avalanchego.asc 70 source /etc/os-release && echo "deb https://downloads.avax.network/apt $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/avalanche.list 71 exit 72 ``` 73 74 #### Installing the Latest Version 75 76 After adding the APT repository, install `avalanchego` by running: 77 78 ```sh 79 sudo apt update 80 sudo apt install avalanchego 81 ``` 82 83 ### Binary Install 84 85 Download the [latest build](https://github.com/ava-labs/avalanchego/releases/latest) for your operating system and architecture. 86 87 The Avalanche binary to be executed is named `avalanchego`. 88 89 ### Docker Install 90 91 Make sure Docker is installed on the machine - so commands like `docker run` etc. are available. 92 93 Building the Docker image of latest `avalanchego` branch can be done by running: 94 95 ```sh 96 ./scripts/build_image.sh 97 ``` 98 99 To check the built image, run: 100 101 ```sh 102 docker image ls 103 ``` 104 105 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: 106 107 ```sh 108 docker run -ti -p 9650:9650 -p 9651:9651 avaplatform/avalanchego:xxxxxxxx /avalanchego/build/avalanchego 109 ``` 110 111 ## Running Avalanche 112 113 ### Connecting to Mainnet 114 115 To connect to the Avalanche Mainnet, run: 116 117 ```sh 118 ./build/avalanchego 119 ``` 120 121 You should see some pretty ASCII art and log messages. 122 123 You can use `Ctrl+C` to kill the node. 124 125 ### Connecting to Fuji 126 127 To connect to the Fuji Testnet, run: 128 129 ```sh 130 ./build/avalanchego --network-id=fuji 131 ``` 132 133 ### Creating a Local Testnet 134 135 The [avalanche-cli](https://github.com/ava-labs/avalanche-cli) is the easiest way to start a local network. 136 137 ```sh 138 avalanche network start 139 avalanche network status 140 ``` 141 142 ## Bootstrapping 143 144 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. 145 146 A node will not [report healthy](https://docs.avax.network/build/avalanchego-apis/health) until it is done bootstrapping. 147 148 Improvements that reduce the amount of time it takes to bootstrap are under development. 149 150 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. 151 152 ## Generating Code 153 154 AvalancheGo uses multiple tools to generate efficient and boilerplate code. 155 156 ### Running protobuf codegen 157 158 To regenerate the protobuf go code, run `scripts/protobuf_codegen.sh` from the root of the repo. 159 160 This should only be necessary when upgrading protobuf versions or modifying .proto definition files. 161 162 To use this script, you must have [buf](https://docs.buf.build/installation) (v1.31.0), protoc-gen-go (v1.33.0) and protoc-gen-go-grpc (v1.3.0) installed. 163 164 To install the buf dependencies: 165 166 ```sh 167 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0 168 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0 169 ``` 170 171 If you have not already, you may need to add `$GOPATH/bin` to your `$PATH`: 172 173 ```sh 174 export PATH="$PATH:$(go env GOPATH)/bin" 175 ``` 176 177 If you extract buf to ~/software/buf/bin, the following should work: 178 179 ```sh 180 export PATH=$PATH:~/software/buf/bin/:~/go/bin 181 go get google.golang.org/protobuf/cmd/protoc-gen-go 182 go get google.golang.org/protobuf/cmd/protoc-gen-go-grpc 183 scripts/protobuf_codegen.sh 184 ``` 185 186 For more information, refer to the [GRPC Golang Quick Start Guide](https://grpc.io/docs/languages/go/quickstart/). 187 188 ### Running mock codegen 189 190 To regenerate the [gomock](https://github.com/uber-go/mock) code, run `scripts/mock.gen.sh` from the root of the repo. 191 192 This should only be necessary when modifying exported interfaces or after modifying `scripts/mock.mockgen.txt`. 193 194 ## Versioning 195 196 ### Version Semantics 197 198 AvalancheGo is first and foremost a client for the Avalanche network. The versioning of AvalancheGo follows that of the Avalanche network. 199 200 - `v0.x.x` indicates a development network version. 201 - `v1.x.x` indicates a production network version. 202 - `vx.[Upgrade].x` indicates the number of network upgrades that have occurred. 203 - `vx.x.[Patch]` indicates the number of client upgrades that have occurred since the last network upgrade. 204 205 ### Library Compatibility Guarantees 206 207 Because AvalancheGo's version denotes the network version, it is expected that interfaces exported by AvalancheGo's packages may change in `Patch` version updates. 208 209 ### API Compatibility Guarantees 210 211 APIs exposed when running AvalancheGo will maintain backwards compatibility, unless the functionality is explicitly deprecated and announced when removed. 212 213 ## Supported Platforms 214 215 AvalancheGo can run on different platforms, with different support tiers: 216 217 - **Tier 1**: Fully supported by the maintainers, guaranteed to pass all tests including e2e and stress tests. 218 - **Tier 2**: Passes all unit and integration tests but not necessarily e2e tests. 219 - **Tier 3**: Builds but lightly tested (or not), considered _experimental_. 220 - **Not supported**: May not build and not tested, considered _unsafe_. To be supported in the future. 221 222 The following table lists currently supported platforms and their corresponding 223 AvalancheGo support tiers: 224 225 | Architecture | Operating system | Support tier | 226 | :----------: | :--------------: | :-----------: | 227 | amd64 | Linux | 1 | 228 | arm64 | Linux | 2 | 229 | amd64 | Darwin | 2 | 230 | amd64 | Windows | 3 | 231 | arm | Linux | Not supported | 232 | i386 | Linux | Not supported | 233 | arm64 | Darwin | Not supported | 234 235 To officially support a new platform, one must satisfy the following requirements: 236 237 | AvalancheGo continuous integration | Tier 1 | Tier 2 | Tier 3 | 238 | ---------------------------------- | :-----: | :-----: | :-----: | 239 | Build passes | ✓ | ✓ | ✓ | 240 | Unit and integration tests pass | ✓ | ✓ | | 241 | End-to-end and stress tests pass | ✓ | | | 242 243 ## Security Bugs 244 245 **We and our community welcome responsible disclosures.** 246 247 Please refer to our [Security Policy](SECURITY.md) and [Security Advisories](https://github.com/ava-labs/avalanchego/security/advisories).