Skip to main content

Install Command Line Interface

This guide explains how to install and use the BBAChain command-line interface (CLI) tools.

Table of Contents

Prerequisites

Before installing the BBAChain CLI, ensure you have the following prerequisites installed on your system:

Required Software

  • Node.js: Version 14 or higher
    • Download from nodejs.org
    • Verify installation: node --version
  • npm: Node package manager (comes with Node.js)
    • Verify installation: npm --version

System Requirements

  • Operating System: Linux, macOS, or Windows
  • Terminal: Command-line terminal or shell
  • Internet Connection: Required for downloading packages
info

If you don't have Node.js installed, download it from nodejs.org and follow the installation instructions for your operating system.

Installation

Step 1: Open Terminal

Open your terminal or command prompt:

  • Linux/macOS: Open Terminal
  • Windows: Open Command Prompt or PowerShell

Step 2: Install BBAChain CLI

Run the following command to install the BBAChain CLI globally:

npm install -g bbachain-cli

This command:

  • Installs the BBAChain CLI package globally
  • Makes the bbachain command available system-wide
  • Downloads and installs all required dependencies
tip

On Linux/macOS, you may need to use sudo for global installation:

sudo npm install -g bbachain-cli

Step 3: Verify Installation

Verify the installation by checking the CLI version:

bbachain --version

Or:

bbachain --version

You should see output similar to:

bbachain-cli 0.1.2 (src:devbuild; feat:3830297737)

If you see the version number, the installation was successful!

Verification

Check Installation

After installation, verify that the CLI is working correctly:

bbachain --help

This command displays the available commands and options.

Check Configuration

You can also check your current configuration:

bbachain config get

This displays your current configuration:

Config File: /home/user/.bbachain/cli/config.yml
RPC URL: https://api-testnet.bbachain.com
WebSocket URL: wss://api-testnet.bbachain.com/ (computed)
Keypair Path: /home/user/.bbachain/id.json
Commitment: confirmed

Basic Usage

Common Commands

Once installed, you can use the BBAChain CLI with various commands:

# Check version
bbachain --version

# Get help
bbachain --help

# View configuration
bbachain config get

# Set configuration
bbachain config set <key> <value>

Example: Connecting to Testnet

To connect to Testnet:

bbachain config set rpcUrl https://api-testnet.bbachain.com

Example: Connecting to Mainnet

To connect to Mainnet:

bbachain config set rpcUrl https://api-mainnet.bbachain.com

Troubleshooting

Installation Issues

If you encounter installation issues:

  1. Check Node.js Version:

    node --version

    Ensure you have Node.js version 14 or higher.

  2. Check npm Version:

    npm --version

    Ensure npm is installed and up to date.

  3. Clear npm Cache:

    npm cache clean --force
  4. Try Reinstalling:

    npm uninstall -g bbachain-cli
    npm install -g bbachain-cli

Permission Issues

If you encounter permission issues:

  • Linux/macOS: Use sudo for global installation
  • Windows: Run Command Prompt as Administrator

Command Not Found

If you get a "command not found" error:

  1. Check Installation: Verify the installation was successful
  2. Check PATH: Ensure npm global bin directory is in your PATH
  3. Restart Terminal: Close and reopen your terminal

Next Steps

Now that you have the BBAChain CLI installed:

  1. Configure your environment: Set up network connections and credentials
  2. Learn about networks: Understand Mainnet vs Testnet
  3. Explore CLI commands: Learn more about available commands
  4. Set up a validator: If you want to run a validator node

Next Steps: Configure your BBAChain environment or learn about networks.