CLI configuration
By default, many Axelar CLI commands contain boilerplate material that obfuscates the command and adds complexity to documentation. Here we describe documentation conventions and ways to configure your system so as to reduce this boilerplate.
Example: As per Send AXL to an EVM chain you can use the CLI to get a deposit address for cross-chain transfer of AXL tokens via the command
axelard tx axelarnet link {EVM_CHAIN} {EVM_DEST_ADDR} uaxl --from my_account
The above command does not work on a system that has not yet been properly configured. On a fresh, unconfigured system you would instead need to type
echo $KEYRING_PASSWORD | ~/.axelar_testnet/bin/axelard tx axelarnet link {EVM_CHAIN} {EVM_DEST_ADDR} uaxl --from validator --gas auto --gas-adjustment 1.5 --chain-id axelar-testnet-lisbon-3 --home ~/.axelar_testnet
Let us explain the changes:
- Keyring password.
echo $KEYRING_PASSWORD: Commands that usetxto post a signed transaction to the network require a password to unlock the keyring. For simplicity documentation elides the keyring password. See Keyring backend for more info. - Path to
axelard.~/.axelar_testnet/bin/axelard: You can avoid the need to type the full path toaxelardby puttingaxelardin yourPATHenvironment variable or defining a shell alias. - Gas.
--gas auto --gas-adjustment 1.5: Commands that usetxto post a signed transaction to the network must pay transaction fees called gas. By defaultaxelardestimates the gas fee but sometimes this estimation is inaccurate and the transaction fails due to insufficient gas fee. These gas flags instructaxelardto estimate gas more accurately, then increase the maximum gas for the transaction by a factor you specify (1.5in this case) so that your transaction is more likely to have sufficient gas even if actual network fees exceed the estimate. For simplicity documentation elides these flags. - Chain ID.
--chain-id axelar-testnet-lisbon-3: Commands that usetxto post a signed transaction to the network must specify thechain-idfor the transaction. You could instead set theAXELARD_CHAIN_IDenvironment variable. - Home directory.
--home ~/.axelar_testnet: Many commands must specify the path to on-disk storage foraxelard. You could instead set theAXELARD_HOMEenvironment variable. The default value is~/.axelar.