Using Initiad

This guide covers the usage of Initiad , a client facing command line interface to interact with the Initia blockchain. Initiad can operate as full node, validator node and client, and when used as a client, it must connect with full node as a RPC. You can query chain state and change chain state by sending a transaction using initiad. By running initiad -h , you can find more information on how to use initiad. For more information about full node operators, refer to Running Initia Node section.

Install Initiad

Installing Initiad is the first step to having access to Initia blockchain. Refer to Download Initiad section for how to install Initiad.

Access a Full Node

Initiad must be connected to a full node to connect to a running network to send queries and transactions through Initiad. Refer to Running Initia Node section to run your own full node.

If yoiu are not running your own full node, you can still interact with Initia blockchain by using the publicly shared RPC endpoints. All query and transaction commands on Initiad have --node flag, and by inputting port and public RPC addresses, you can get remote full node access.

Configuring Initiad

You may enter option for every command execution on Initiad, but you can also save pre-set configuration values to skip entering option for every command execution.

# init initiad with default setting
initiad init local --chain-id testnet

# modify node section to the remote full node rpc address.
vim ~/.initia/config/client.toml

Keys

initiad keys command is used to saving and managing private keys on a local device keyring, where the saved keys can be used to execute transaction commands.

initiad keys add <your-key-name> [flags]

Querying

initiad query command provides an interface for chain state query, and each of Cosmos modules and CometBFT (prev. Tendermint) provide client facing query interface.

initiad query [module-name] [query-name] ... [flags]
# ex) initiad query bank balances [address]

Transactions

initiad tx command is an operation to update chain state by sending a transaction, and each of Cosmos modules provide a client facing tx interface.

initiad tx [module-name] [tx-name] ... [flags]
# ex) initiad tx bank send [from-addr] [to-addr] [amount] [flags]

Fees

Transactions on Initia blockchain require users to pay a transaction fee with INIT, where the amount is calculated based on gas_limit. INIT fee amount is calculated by the product of gas_limit and base_min_gas_price from Move Params.

base_fee = gas_limit * base_min_gas_price

Initia blockchain has a native DEX which can be utilized for users to choose various token denoms to pay transaction fee. When a user selects a denom from the list of whitelisted tokens to pay transaction fee, Initia blockchain swaps the selected token into INIT on the native DEX and runs a fee check.

Setting Fees

There are 2 ways to set fees on initiad. Unlike other Cosmos chains, when user is setting fees on Initia blockchain, user must check base_min_gas_price and base_denom which are on-chain Move parameters. On-chain parameters can be checked on Chain Parameters section.

Set with fees flag

User can directly set the final fee amount.

initiad tx bank send ... \
  --fees=10000uinit

Set with gas-prices flag

Or, the user can set the gas-prices which is multiplied to gas_limit to send transaction.

initiad tx bank send ... \
  --gas-prices=0.15uinit

Fee Estimation

By using initiad, users can estimate the gas amount which is the measurement of how much resource a certain transaction will spend, and set the final fee amount using the estimated gas amount. By applying --gas=auto to the transaction command you can get the estimated gas amount. A --gas-adjustment flag can be used to adjust the originally estimated gas amount to make sure the transaction is broadcasted successfully.

initiad tx bank send [sender] [to] [amount] \
  --chain-id [chain-id]                     \
  --gas-prices 0.15uinit                    \
  --gas-adjustment 1.4.                     \
  --gas auto

Last updated