Skip to content

Instantly share code, notes, and snippets.

@cgcardona
Last active December 2, 2022 03:16
Show Gist options
  • Save cgcardona/4a5c9d0dbe7fdbe6ffce77fa05e9e580 to your computer and use it in GitHub Desktop.
Save cgcardona/4a5c9d0dbe7fdbe6ffce77fa05e9e580 to your computer and use it in GitHub Desktop.
Steps for firing up an Avalanche full node

Steps for firing up a full Avalanche node

Avalanche is an open-source platform for launching highly decentralized applications, financial primitives, and interoperable blockchains.

These are steps for firing up an Avalanche full node on Digital Ocean.

Digital Ocean Ubuntu Instance

ssh into a Digital Ocean Ubuntu box

Requirements

OS

Ubuntu 18.04.3 (LTS) x64

Hardware

  • 8 GB / 4 CPUs
  • 160 GB SSD Disk
  • 5 TB transfer

Update and upgrade

apt-get update -y
apt-get upgrade -y
sudo reboot

Install Avalanche deps and oh-my-zsh

sudo apt-get install git tig curl build-essential libssl-dev libuv1-dev cmake make g++ zsh ack tree -y
yes Y | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && zsh

Install golang

wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.14.4.linux-amd64.tar.gz

Configure vim

wget https://raw.githubusercontent.com/cgcardona/dotfiles/master/.vimrc

Set env vars by adding the following to your ~/.zshrc file

export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go

Reload your .zshrc file

source ~/.zshrc

Clone the AvalancheGo rep

go get -v -d github.com/ava-labs/avalanchego/...
cd $GOPATH/src/github.com/ava-labs/avalanchego

Build the executable

./scripts/build.sh

Create new tmux session

tmux new -s avax-infra
zsh

Connect to the Public Testnet

./build/avalanchego

We need to create a validating key for our node so that our node can be identified on the platform chain. We can create a randomly generated tls certificate for this. This is for starting the node and becoming a validator.

A key/cert pair are auto generated the first time the node is started with no key/cert passed in. The key/cert are located at ~/.avalanchego/staking/staker.crt and ~/.avalanchego/staking/staker.key.

You can also specify your own key/cert locations using the staking-tls-cert-file and staking-tls-key-file params.

Confirm the full node has peers

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "admin.peers",
    "params":{},
    "id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin

Install Avash

go get github.com/ava-labs/avash
cd $GOPATH/src/github.com/ava-labs/avash
go build
./avash
avash> runscript scripts/five_node_staking.lua

Install Faucet

First install the node version manager nvm

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | zsh
source ~/.zshrc

Next, install NodeJS v12.14.1

nvm install v12.14.1

Clone the repo and install the deps

git clone https://github.com/ava-labs/faucet-site.git
cd faucet-site
npm install
cp .env.example .env

Set the .env config

AVA_IP — The IP Address of the AVA node. Try: “localhost”
AVA_PORT — The port of the AVA node. Try: 9650
AVA_PROTOCOL — Either http or https. Try: “http”
AVA_NETWORK_ID — The NetworkID of the AVA node. Try: 12345
AVA_CHAIN_ID — The BlockchainID of the AVM. Try: “X”
CAPTCHA_SECRET — A captcha secret from Google reCaptcha (https://www.google.com/recaptcha/admin/create)
VUE_APP_CAPTCHA_SITE_KEY — A public site captcha key from Google reCaptcha
ASSET_ID — Which asset id is the official AVA Token. Try: “AVA”
PRIVATE_KEY — A private key with funds in it. Try: “ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN”
DROP_SIZE — How much nanoAvas is given from this faucet. Try: 25 for 25 nanoAVA

Run the app

npm run serve

Go to https://localhost:8081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment