๐Ÿš€galacticad CLI Usage Cheat Sheet

This guide provides essential commands for managing your account and validator on the Galactica Network using the galacticad CLI.

Installation and Setup

For detailed instructions on installing galacticad, please refer to our comprehensive Installation Guide.

Node Setup

For every command, replace [chain_id] with the appropriate chain ID for the network you're interacting with. You can also specify custom home directories using the --home flag:

galacticad [command] --chain-id [chain_id] --home [home_directory]

Configure Node Client RPC

Set the RPC node URL for the client to connect to.

galacticad config node [rpc_node_url]

Initialize Node

Initialize a new node home directory with a moniker and chain ID. This command creates a new node configuration in the specified home directory.

galacticad init [moniker] --chain-id [chain_id]

Start Node

Start your node to begin syncing with the network.

galacticad start --chain-id [chain_id]

Show Node Info

Display information about node status, including the latest block height and other details. This command queries the node set by galacticad config node [rpc_node_url].

galacticad status

Keys Management

Create a New key

galacticad keys add [key_name]

After entering the command, you need to input the passphrase for the keys. You might need to re-enter the passphrase.

Example output:

Enter keyring passphrase (attempt 1/3): #
Re-enter keyring passphrase:

- address: [gala_address]
  name: [key_name]
  pubkey: [public_key]
  type: local


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

<<seed phrase here>>

Import mnemonic

If you already have a mnemonic phrase, you can import it using the following command:

galacticad keys add [key_name] --recover

Export a Key

Export your key to a file for backup.

galacticad keys export [key_name] > [key_file]

Import a Key

Import a key from a file.

galacticad keys import [key_name] [key_file]

Delete a Key

galacticad keys delete [key_name]

Show Gala Address

Displays the Gala address associated with your key. The -a flag shows the address only. It has a prefix gala.

galacticad keys show [key_name] -a

Show ETH Address

Converts your Gala address to an Ethereum-compatible address. It is useful for interacting with Ethereum-based DAPPs or wallets. It is in hex format (with the 0x prefix).

galacticad keys convert-bech32-to-hex $(galacticad keys show [key_name] -a)

Export Ethereum Private Key in Hex Format

Exports your Ethereum private key for use in other wallets or applications. You could import this key into a wallet like MetaMask or Keplr.

galacticad keys unsafe-export-eth-key [key_name]

Check Account Balance

Displays the current balance of your account.

galacticad query bank balances $(galacticad keys show [key_name] -a)

Validator Management

Get Validator Address

Validator address is required for staking and other validator-specific operations. It has prefix galavaloper.

galacticad keys show [key_name] --bech val -a

Get Consensus Address

Consensus address is the address used for consensus operations. It has prefix galacons.

galacticad keys show [key_name] --bech cons -a

Get Validator Public Key

Validator public key is used for signing blocks and other validator operations. It is in bech32 format.

galacticad keys show [key_name] --bech val -p

Get Consensus Public Key

Consensus public key is used for consensus operations. It is in bech32 format.

galacticad keys show [key_name] --bech cons -p

Sharing your Peer ID

Your node's Peer ID is required for P2P communication. You can share it with other validators to establish connections.

galacticad tendermint show-node-id
  • Peer Format: node_id@ip:port

  • Example: c722e6dc5f762b0ef19be7f8cc8fd67cdf988946@seed01-reticulum.galactica.com:26656

Staking and Rewards

Get address delegations

galacticad query staking delegations $(galacticad keys show [key_name] -a)

Delegate Tokens

Delegate tokens to a validator. Replace [amount_agnet] with the amount of tokens you wish to delegate.

galacticad tx staking delegate \
    $(galacticad keys show [key_name] --bech val -a) \
    [amount_agnet] \
    --gas="200000" \
    --gas-prices="100agnet" \
    --from=[key_name]

Unbond Tokens

Unbond tokens from a validator.

galacticad tx staking unbond \
    $(galacticad keys show [key_name] --bech val -a) \
    [amount_agnet] \
    --gas="200000" \
    --gas-prices="100agnet" \
    --from=[key_name]

Redelegate Tokens

Redelegate tokens from one validator to another. First argument is the source validator, and the second argument is the destination validator address.

galacticad tx staking redelegate \
    $(galacticad keys show [key_name_src] --bech val -a) \
    $(galacticad keys show [key_name_dst] --bech val -a) \
    [amount_agnet] \
    --gas="200000" \
    --gas-prices="100agnet" \
    --from=[key_name]

Withdraw Rewards

Withdraw staking rewards, including commission if you're a validator.

galacticad tx distribution withdraw-rewards \
  $(galacticad keys show [key_name] --bech val -a) \
  --from=[key_name] \
  --commission \
  --gas="200000" \
  --gas-prices="100agnet"

Validator Unjailing

Unjail Validator

Unjail your validator if it has been jailed for downtime.

galacticad tx slashing unjail \
  --from=[key_name] \
  --gas="300000" \
  --gas-prices="100agnet"

Jail reason

galacticad query slashing signing-info [validator-conspub]

Governance

Get list of proposals

galacticad query gov proposals

Get proposal details

galacticad query gov proposal [proposal_id]

Vote on a proposal

galacticad tx gov vote [proposal_id] [yes|no|no_with_veto|abstain] --from [key_name]

Submit a proposal

galacticad tx gov submit-proposal [proposal_type: text|param_change|software_upgrade] [proposal_file] --from [key_name]

Validators

Get list of validators

galacticad query staking validators

Get validator info

galacticad query staking validator [validator_address]

Transactions

Get Transaction Info by Hash

galacticad query tx [tx_hash]

For more advanced commands and network-specific details, refer to the galacticad help command:

galacticad --help

This cheat sheet covers basic commands needed to interact with the Galactica Network via the galacticad CLI.

Last updated