The initiad CLI is a command-line
interface for interacting with the Initia L1. This tool provides comprehensive
functionality for developers and users to manage accounts, query blockchain
data, submit transactions, and perform other operations.
Overview
With initiad, you can:
- Account Management: Create, import, and manage blockchain accounts
- Transaction Operations: Send transactions, delegate tokens, and interact
with smart contracts
- Data Queries: Query blockchain state, account balances, and transaction
history
- Validator Operations: Create validators, delegate stakes, and manage
governance proposals
- Network Interaction: Connect to different networks (mainnet, testnet,
local)
initiad is built using the Cosmos SDK and provides a familiar interface for
users of other Cosmos-based chains.
Prerequisites
Before installing initiad, ensure you have the following requirements:
- Go: Version 1.21 or higher
- Git: For cloning the repository
- Make: For building the binary
You can verify your Go installation by running go version in your terminal.
Installation
Clone the Repository
First, clone the initiad repository from GitHub:git clone https://github.com/initia-labs/initia.git
cd initia
Get Version and Checkout
Fetch the current network version and checkout the corresponding tag. Choose the network that matches your intended use case:# Get the current mainnet version and checkout
export VERSION=$(curl -s https://rest.initia.xyz/cosmos/base/tendermint/v1beta1/node_info | jq -r '.application_version.version' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+')
echo "Checking out version: $VERSION"
git checkout $VERSION
# Get the current testnet version and checkout export VERSION=$(curl
-s https://rest.testnet.initia.xyz/cosmos/base/tendermint/v1beta1/node_info |
jq -r '.application_version.version' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+')
echo "Checking out version: $VERSION" git checkout $VERSION ```
</Tab>
<Tab title="Manual">
```bash
# Manually set a specific version and checkout
export VERSION=v0.5.7
echo "Checking out version: $VERSION"
git checkout $VERSION
Always use a specific version tag rather than the main branch for production
environments to ensure stability.
Mainnet and testnet may run different versions, so choose the appropriate network endpoint.
Build and Install
Compile and install the initiad binary:This will build the binary and install it to your $GOPATH/bin directory.
Verification
After installation, verify that initiad is correctly installed and accessible:
Check CLI Version
initiad version
# Output: v0.5.7
Verify Installation Path
which initiad
# Output: /Users/username/go/bin/initiad (or your $GOPATH/bin path)
Check Available Commands
Network Configuration
By default, initiad connects to the Initia mainnet. You can configure it to
connect to different networks:
initiad config chain-id initia-1
initiad config node https://rpc.initia.xyz:443
initiad config chain-id initiation-1 initiad config node
https://rpc.testnet.initia.xyz:443 ```
</Tab>
<Tab title="Local Node">
```bash
initiad config chain-id local-initia
initiad config node tcp://localhost:26657
Next Steps
Now that you have initiad installed and configured, you can: