Skip to content

MatthieuLvsr/docker-avalanche-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Avalanche Node and CLI Setup

This project sets up an Avalanche node and CLI environment using Docker Compose. The setup includes:

  1. Avalanche Node: Runs a full Avalanche node.
  2. Avalanche CLI: Provides tools for managing subnets and blockchains.

Prerequisites

  • Docker
  • Docker Compose

Getting Started

Clone the repository
git clone https://github.com/MatthieuLvsr/docker-avalanche-cli.git
cd docker-avalanche-cli
Build and Start the Services

To start the Avalanche Node and CLI:

docker-compose up --build -d
Directory Structure
  • config/: Contains configuration files for the Avalanche Node.
  • data/: Stores the blockchain data.
  • cli-data/: Persistent storage for Avalanche CLI.

Services Overview

Avalanche Node
  • Provides the core functionality for running an Avalanche blockchain node.
  • Accessible at:
    • Port 9650: API
    • Port 9651: Peering
Avalanche CLI
  • Used to create and manage subnets, blockchains, and validators.
  • Access via:
docker exec -it avalanche-cli /bin/bash

Common Commands

Check Node Status

To check the status of the Avalanche node:

curl -X POST --data '{"jsonrpc":"2.0","method":"info.isBootstrapped","params":{"chain":"C"},"id":1}' -H 'content-type:application/json;' http://localhost:9650/ext/info
Access CLI

To open a bash shell in the CLI container:

docker exec -it avalanche-cli /bin/bash
Create a Subnet

To create a new subnet:

avalanche subnet create my-subnet
Deploy a Subnet

To deploy a subnet on the Fuji testnet:

avalanche subnet deploy my-subnet --fuji
Stop the Services

To stop all services:

docker-compose down

Quick Start with Makefile

  1. Start all services:
make up
  1. Access Avalanche CLI:
make cli
  1. Check the node status:
make status
  1. Create and deploy a subnet:
make create-subnet
make deploy-subnet
  1. Stop all services:
make down

About

Avalanche Node and CLI on Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published