Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Development Environment Setup

This is Gabriel Cardona's AVA Labs-centric development environment setup. Use at your own risk. Your mileage may vary.


iTerm2 is a replacement for Terminal


I prefer zsh to bash. Here is a small list of the many features which make zsh my preference.

  • Automatic cd: Just type the name of the directory
  • Recursive path expansion: For example /u/lo/b expands to /usr/local/bin
  • Spelling correction and approximate completion: If you make a minor mistake typing a directory name, ZSH will fix it for you
  • Plugin and theme support: ZSH includes many different plugin frameworks

As of MacOS 10.15.x Catalina the default shell on a Macbook is zsh.

oh-my-zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, and themes.

Install via curl

sh -c "$(curl -fsSL"

Install via wget

sh -c "$(wget -O -)"


Install GoLang version >= 1.15.5 and set up it's $GOPATH.


AvalancheGo is the official node implementation of the Avalanche network

Clone the repo

go get -v -d
cd $GOPATH/src/

Build the executable


The Avalanche binary, named avalanchego, is in the build/ directory.


Avash is the avalanche shell client. It is the Avalanche network's local/private testnet.

First build AvalancheGo. Then:

go get
cd $GOPATH/src/
go build

Now you can fire up a 5 node staking network:

Config file set: /Users/username/.avash.yaml
Avash successfully configured.
avash> runscript scripts/five_node_staking.lua
RunScript: Running scripts/five_node_staking.lua
RunScript: Successfully ran scripts/five_node_staking.lua

POSTMan Collection

The POSTMAN Collection has full support for the entire RPC of the X-Chain, C-Chain and P-Chain.

Node Version Manager

nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. Currently we're using nodeJS v12.14.1. There's a new LTS but our wallet team has asked that we stay on this version due to issues upgrading the web wallet.


wget -qO- | bash

List remote versions

nvm ls-remote

List installed versions

nvm ls

Install a version

nvm install v14.16.0

Use an installed version

nvm use 14.16.0

Default to an installed version

nvm default 14.16.0

TS Node

ts-node is a TypeScript execution and REPL for node.js, with source map support.


# With TypeScript.
npm install -g typescript
npm install -g ts-node


# Execute a script as `node` + `tsc`.
ts-node script.ts

# Starts a TypeScript REPL.

VSCode Debugging

VSCode is a great text editor and Typescript development environment. Debugging


  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "lib": ["es2015", "dom"],
    "allowJs": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "outDir": "dist",
    "strict": true,
    "noImplicitAny": true,
    "moduleResolution": "node",
    "baseUrl": "./",
    "esModuleInterop": true
  "include": ["*"],
  "exclude": ["node_modules"]


  "version": "0.2.0",
  "configurations": [
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "skipFiles": [
      "program": "${workspaceFolder}/FILENAME-TO-CHANGE.ts",
      "preLaunchTask": "tsc: build - tsconfig.json",
      "outFiles": [


  1. Add breakpoinst to FILENAME-TO-CHANGE from the previous step.
  2. Open the "Run" tab with cmd+shift+D.
  3. Have the top dropdown menu read "Launch Program" and click the green "Start Debugging" play button.
  4. If you see a popup error click "Debug Anyway"
  5. You'll now be debugging. You can step over/in/out of functions. You can observe the stack. You can inspect variable values and call methods from the debug terminal tab.


AvalancheJS is the javascript/typescript client for the Avalanche Network. To build the library locally

git clone
cd avalanchejs
npm install
npm run build
npm test

There are dozens of example scripts( to test which you can run with ts-node. First make sure that a local network is running via avash.

ts-node examples/info/peers.ts
    ip: '',
    publicIP: '',
    nodeID: 'NodeID-NFBbbJ4qCmNaCzeW7sxErhvWqvEQMnYcN',
    version: 'avalanche/1.2.0',
    lastSent: '2021-02-16T16:24:42-08:00',
    lastReceived: '2021-02-16T16:24:42-08:00'
    ip: '',
    publicIP: '',
    nodeID: 'NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ',
    version: 'avalanche/1.2.0',
    lastSent: '2021-02-16T16:24:42-08:00',
    lastReceived: '2021-02-16T16:24:42-08:00'
    ip: '',
    publicIP: '',
    nodeID: 'NodeID-GWPcbFJZFfZreETSoWjPimr846mXEKCtu',
    version: 'avalanche/1.2.0',
    lastSent: '2021-02-16T16:24:42-08:00',
    lastReceived: '2021-02-16T16:24:42-08:00'
    ip: '',
    publicIP: '',
    nodeID: 'NodeID-P7oB2McjBGgW2NXXWVYjV8JEDFoW9xDE5',
    version: 'avalanche/1.2.0',
    lastSent: '2021-02-16T16:24:42-08:00',
    lastReceived: '2021-02-16T16:24:42-08:00'

Web Wallet

Web Wallet





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