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.
The KOII CLI can be installed in various ways based on your operating system:
Windows
-
Open a Command Prompt (cmd.exe) as an Administrator:
- In the Windows search bar, type "Command Prompt."
- When the Command Prompt app appears, right-click on it and select "Open as Administrator."
- If a pop-up window asks, "Do you want to allow this app to make changes to your device?," click "Yes."
-
Download the Koii installer into a temporary directory:
-
Copy and paste the following command into the Command Prompt, then press Enter:
cmd /c "curl -L https://github.com/koii-network/k2-release/releases/download/v1.16.2/koii-install-init-x86_64-pc-windows-msvc.exe --output C:\koii-install-tmp\koii-install-init.exe --create-dirs"
tip- If the above step doesn't work, you can manually download the .exe program from this URL: (https://github.com/koii-network/k2-release/releases/download/v1.16.2/koii-install-init-x86_64-pc-windows-msvc.exe).
- Your browser may display a warning about the file being potentially harmful. Please accept to keep the file.
- After downloading, copy and paste the downloaded file to the location
C:\koii-install-tmp\
and rename it to "koii-install-init.exe."
-
-
Install the latest version of the Koii CLI:
- Copy and paste the following command into the Command Prompt, then press Enter.
C:\koii-install-tmp\koii-install-init.exe v1.16.2
- If your system displays a security pop-up, select "Allow" to run the program.
-
Wait for the installer to complete, and then press Enter.
-
Close the Command Prompt window and open a new one as a normal user.
-
To confirm that the Koii CLI was successfully installed, run the following command:
koii --version
-
You should see the version information similar to this:
koii-cli 1.16.2
-
MacOS & Linux
- 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.
-
Copy and run the command provided below the prompt. This command will update your
PATH
environment variable to include the Koii programs. -
To confirm that your
PATH
environment variable has been successfully updated, run the following command:
echo $PATH
- To confirm that the Koii CLI was successfully installed, run the following command:
koii --version
You should see the version information similar to this:
koii-cli 1.16.2
Additional Steps for Mac Users
Mac users may encounter issues with the Koii CLI not working in a new terminal session. To resolve this, follow these steps:
-
After installing the Koii CLI, copy the
PATH
value. -
In your terminal, run the command
vi ~/.zshrc
-
This will open the
~/.zshrc
file in the vi text editor. Insert the following line, replacing<path>
with the copiedPATH
value:export <path>
This line will add the Koii CLI path to your shell configuration.
-
Save and exit the editor. You can do this by pressing the Esc key, typing
:wq
, and then pressing Enter. -
Now, the Koii CLI should work correctly in any new terminal session.
After installing the cli
Set the testnet rpc endpoint correctly Run this command:
koii config set --url https://testnet.koii.network
Feel free to reach out if you have any further questions or need assistance.