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
- Verify installation:
System Requirements
- Operating System: Linux, macOS, or Windows
- Terminal: Command-line terminal or shell
- Internet Connection: Required for downloading packages
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
bbachaincommand available system-wide - Downloads and installs all required dependencies
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:
-
Check Node.js Version:
node --versionEnsure you have Node.js version 14 or higher.
-
Check npm Version:
npm --versionEnsure npm is installed and up to date.
-
Clear npm Cache:
npm cache clean --force -
Try Reinstalling:
npm uninstall -g bbachain-cli
npm install -g bbachain-cli
Permission Issues
If you encounter permission issues:
- Linux/macOS: Use
sudofor global installation - Windows: Run Command Prompt as Administrator
Command Not Found
If you get a "command not found" error:
- Check Installation: Verify the installation was successful
- Check PATH: Ensure npm global bin directory is in your PATH
- Restart Terminal: Close and reopen your terminal
Next Steps
Now that you have the BBAChain CLI installed:
- Configure your environment: Set up network connections and credentials
- Learn about networks: Understand Mainnet vs Testnet
- Explore CLI commands: Learn more about available commands
- Set up a validator: If you want to run a validator node
Related Topics
- Learn about configuration options
- Understand BBAChain networks
- Set up a validator node
- Explore consensus mechanism
Next Steps: Configure your BBAChain environment or learn about networks.