Usage - Galactica-corp/galactica GitHub Wiki

Check the config

After installing you'll need to configure galacticad first to use the public node to be able to get info from the network.

Check the config file to know from where exactly galacticad will get info and how it will manage your keys. The config file by default is in ~/.galactica/config/client.toml

For our first purpose, you need to make minimal configuration with your client:

  • set the key storage method (keyring-backend): file is recommended - it will encrypt your key with a password and store it in the file
  • set at least one endpoint (seed) of node
  • set the chain-id of the blockchain you will interact with
# set keyring-backend
galacticad config keyring-backend file
# set one of node endpoint from seeds.txt
galacticad config node tcp://[email protected]:26657
# set chain-id galaandr_41238-41238 to interact with devnet
galacticad config chain-id galaandr_41238-41238

Alias

For easy use, you can create a temporary alias to galacticad with preconfigured params:

alias gala="galacticad --home $MAIN_PATH_HOME --keyring-backend $KEYRING_BACKEND --keyring-dir $MAIN_PATH_HOME"

Additionaly you can add this alias to your environment by default:

echo alias gala="galacticad --home $(realpath MAIN_PATH_HOME) --keyring-backend $KEYRING_BACKEND --keyring-dir $(realpath MAIN_PATH_HOME)" >> ~/.bashrc

Get a wallet

Generate keys

If you need to create wallet:

Choose a name for the key, it will be needed if you want to export info from it

export KEY_NAME=gala_wallet

Create a key with the command:

galacticad keys add $KEY_NAME --algo eth_secp256k1 --home $MAIN_PATH_HOME --keyring-backend $KEYRING_BACKEND --keyring-dir $MAIN_PATH_HOME

After entering the command you need to input the passphrase for keys, you might need to reenter the passphrase

example output

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

- address: gala16gj4hjxnt9fsmsxuyyma7kvhqz4gue5ylnney4
  name: gala_wallet
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AhA8bFj0nrIB7GaTj23Rgw4S+HW0RNZVKMj+eZHa4UE+"}'
  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>>

Importing keys

In another case: if you already created a key and now for using it in the validator instance it needs to be placed in the path $MAIN_PATH_HOME/keyring-$KEYRING_BACKEND.

You can export and import key with previous place with command:

galacticad --home ~/.galacticad keys export $YOUR_KEY_NAME > $MAIN_PATH_HOME/exported_key

example output

Enter passphrase to encrypt the exported key:

Here you need to input a password that will be needed to import that exact key in another place/instance

Additionally you may need to enter password from your previous key-store if it was encrypted

Import the key in another instance with the command:

galacticad --keyring-backend file --home=$MAIN_PATH_HOME keys import $KEY_NAME exported_key

example output

Enter passphrase to decrypt your key:
Enter keyring passphrase (attempt 1/3):
Re-enter keyring passphrase:

Get your wallet`s address

galacticad keys show $KEY_NAME -a --keyring-backend file --keyring-dir $MAIN_PATH_HOME

example output

gala16gj4hjxnt9fsmsxuyyma7kvhqz4gue5ylnney4

Get the address for the validator

To get info about your validator address use the command below:

galacticad keys show $KEY_NAME --bech val --keyring-backend file --keyring-dir $MAIN_PATH_HOME

example output

- address: galavaloper16gj4hjxnt9fsmsxuyyma7kvhqz4gue5yj6glgu
   name: gala_wallet
   pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AhA8bFj0nrIB7GaTj23Rgw4S+HW0RNZVKMj+eZHa4UE+"}'
   type: local

To get just address:

galacticad keys show $KEY_NAME --bech val -a --keyring-dir $MAIN_PATH_HOME
# galavaloper16gj4hjxnt9fsmsxuyyma7kvhqz4gue5yj6glgu

Check your balance

gala query bank balances $ADDR

Send funds to another wallet

# get addr of treasury
export SENDER=$(gala keys show sender -a --keyring-backend test)
# set chainid
export CHAIN_ID=galaandr_41238-41238
# set amount in agnet
export AMOUNT=1000000000000

gala tx bank send $SENDER $ANOTHER_WALLET_ADDR `$AMOUNT`agnet --fees 2000000agnet

Form address into etherium form

For getting token from faucet you need to know your wallet addres in eth format

gala keys convert-bech32-to-hex `gala keys show $KEY -a`

Get info about transaction from hash

To get info about transaction in case you know hash of transaction you can check its status with command:

gala query tx --type=hash B8B15907986C3BAA6B13BC28D7053C302256D55FF76CCC751B873BFE2C42E8A6