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.
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
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)
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
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:
- Build BBAChain from source: Build and install the validator software (recommended)
- Generate keypairs: Create the required keypairs for your validator
- Configure your validator: Set up your validator node configuration
Troubleshooting
Installation Issues
If you encounter issues during installation:
-
Check Node.js Version:
node --versionEnsure you have Node.js version 14 or higher.
-
Check npm Version:
npm --version -
Clear npm Cache:
npm cache clean --force -
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
sudofor global installation - Windows: Run Command Prompt as Administrator
Related Topics
- Learn about validator requirements
- Configure your validator node
- Build BBAChain from source (recommended for validators)
- Generate keypairs for your validator
- Understand BBAChain networks
Next Steps:
- For validator setup: Build BBAChain from source (recommended)
- If you only need CLI: Generate keypairs or proceed with your workflow