Install the Koii CLI Suite
Prerequisites
Before installing the Koii CLI, ensure you have:
- A stable internet connection
- Administrator/sudo privileges
- For Windows: Windows 10 or later
- For MacOS: macOS 10.15 or later
- For Linux: Ubuntu 20.04+, Debian 10+, or equivalent
Overview
To interact with the K2 network locally, you must install the Koii CLI. The Koii CLI is equipped with a range of essential features, such as:
-
Generating a Koii wallet: With the Koii CLI, you can easily create a wallet specifically designed for Koii interactions.
-
Running Koii test validator: The Koii CLI allows you to execute a test validator, enabling you to test and validate your Koii-related functionalities locally.
By using the Koii CLI, you can seamlessly interact with the K2 network within your local development environment, empowering you to build and test your applications efficiently.
MacOS & Linux Installation
- Open your terminal and execute the following command:
sh -c "$(curl -sSfL https://raw.githubusercontent.com/koii-network/k2-release/master/k2-install-init.sh)"
This command will download and install the necessary Koii tools.
- Depending on your operating system, you may receive the following prompt:
Please update your PATH environment variable to include the koii programs:
If you encounter this message, proceed to the next step. Otherwise, move on to step 4.
-
Update your PATH environment variable:
For Bash users:
echo 'export PATH="$HOME/.local/share/koii/install/active_release/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcFor Zsh users:
echo 'export PATH="$HOME/.local/share/koii/install/active_release/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc -
To confirm that your
PATH
environment variable has been successfully updated, run:
echo $PATH
- Verify the installation by running:
koii --version
You should see the version information similar to this:
koii-cli 1.16.2
Windows Installation
-
Open a Command Prompt (cmd.exe) as an Administrator:
- Press Windows key
- Type "Command Prompt" (or cmd)
- Right-click and select "Run as administrator"
- Click "Yes" if prompted by User Account Control
-
Create a temporary directory and download the installer:
mkdir C:\koii-install-tmp
cd C:\koii-install-tmp
curl -L https://github.com/koii-network/k2-release/releases/latest/download/koii-install-init-x86_64-pc-windows-msvc.exe --output koii-install-init.exeAlternative DownloadIf the above command doesn't work:
- Visit the latest release page
- Download
koii-install-init-x86_64-pc-windows-msvc.exe
- Move it to
C:\koii-install-tmp\koii-install-init.exe
-
Run the installer:
koii-install-init.exe
- If Windows Defender or antivirus blocks the installation, click "More info" and then "Run anyway"
-
Close the current Command Prompt and open a new one as a normal user
-
Verify the installation:
koii --version
Configuration
After installation, you need to configure your RPC endpoint:
-
For Testnet (default):
koii config set --url https://testnet.koii.network
-
For Mainnet:
koii config set --url https://mainnet.koii.network
Troubleshooting
Common Issues
-
Command not found after installation
- Ensure you've added the PATH to your shell configuration file
- Restart your terminal
- For Windows, ensure you're running as a normal user, not administrator
-
Permission denied errors
- For MacOS/Linux: Run
chmod +x ~/.local/share/koii/install/active_release/bin/koii
- For Windows: Run Command Prompt as administrator
- For MacOS/Linux: Run
-
Antivirus blocking installation
- Temporarily disable antivirus
- Add an exception for the Koii installation directory
Updating the CLI
To update to the latest version:
koii-install update
Uninstallation
To remove the Koii CLI:
-
MacOS/Linux:
rm -rf ~/.local/share/koii
-
Windows:
rmdir /s /q %USERPROFILE%\.local\share\koii
Need help? Join our Discord community for support.