Skip to main content

Install BBAChain CLI (Alternative Method)

This guide provides an alternative method to install the BBAChain CLI via npm. If you're building BBAChain from source (recommended), the CLI and keygen tools will be included in the build. Use this guide only if you prefer to install the CLI separately via npm.

info

Recommended: If you're setting up a validator, we recommend building from source which includes the validator software, CLI, and keygen tools. This guide is for users who only need the CLI tools without building the full validator.

Table of Contents

Prerequisites

Before installing the BBAChain CLI, ensure you have:

  • Node.js: Version 14 or higher installed
  • npm: Node package manager (comes with Node.js)
  • Terminal Access: Command-line access to your system
  • Internet Connection: Required for downloading packages

Installation Steps

Step 1: Install BBAChain CLI

Install the BBAChain CLI globally using npm:

npm install -g bbachain-cli
tip

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

sudo npm install -g bbachain-cli

Step 2: Verify Installation

Once the BBAChain CLI is installed, verify it by running:

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 CLI Version

Verify the CLI is working correctly:

bbachain --version

Expected output:

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

Check Available Commands

View available commands:

bbachain --help

This displays all available commands and options.

Configuration Check

After successfully installing the CLI, check your configuration:

bbachain config get

This command displays your current configuration:

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

Configuration Details

The output shows:

  • Config File: Path to your configuration file
  • RPC URL: The RPC endpoint URL (defaults to Testnet)
  • WebSocket URL: The WebSocket endpoint URL (computed automatically)
  • Keypair Path: Path to your keypair file
  • Commitment: Commitment level (processed, confirmed, or finalized)
info

By default, the CLI connects to Testnet. To connect to Mainnet, you'll need to configure it. See the configuration guide for details.

When to Use This Method

Use this npm installation method if:

  • You only need the CLI tools (not the full validator software)
  • You're using pre-built validator binaries
  • You prefer npm-based installation over building from source
tip

For Validator Setup: If you're setting up a validator node, we recommend building from source which includes all necessary tools (validator, CLI, and keygen) in one step.

Next Steps

If you've installed the CLI via npm and are setting up a validator:

  1. Build BBAChain from source: Build and install the validator software (recommended)
  2. Generate keypairs: Create the required keypairs for your validator
  3. Configure your validator: Set up your validator node configuration

Troubleshooting

Installation Issues

If you encounter issues during installation:

  1. Check Node.js Version:

    node --version

    Ensure you have Node.js version 14 or higher.

  2. Check npm Version:

    npm --version
  3. Clear npm Cache:

    npm cache clean --force
  4. Reinstall:

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

Command Not Found

If you get a "command not found" error:

  • Verify the installation was successful
  • Check that npm global bin directory is in your PATH
  • Restart your terminal

Permission Issues

If you encounter permission issues:

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

Next Steps: