Andromeda
Search…
⌃K

Chain

Manage chains and configs

Available Commands

Command
Description
config
Displays current chain config.
copy
Creates a copy of a current config.
get
Displays current value for a given key.
list
Lists all the currently saved configs.
new
Creates a new config.
rm
Removes a config by name or chain ID.
set
Sets the value for a given config key.
use
Swap to a saved config.

Config

Displays the config of the chain.
Key
Description
chainName
The name of the chain.
chainId
The ID of the chain to use
chainUrl
The URL of the chain to use
registryAddress
The contract address of the Andromeda Registry
addressPrefix
The prefix for all addresses on chain
defualtFee
The default fee amount
blockExplorerTxPages
URLs to block explorers for the given chain. Must include '${txHash}'
blockExplorerAddressPages
URLs to block explorers for the given chain. Must include '${txHash}'
chainType
The type of chain (Testnet or Mainnet).
iconUrl
The icon for the chain.

Usage

chain config

Example

? [email protected]> chain config
The above command will generate an output similar to:
Current chain config
Key Value Description
name elgafar1 The name of the chain config used
chainName Stargaze The name of the chain
chainId elgafar-1 The ID of the chain to use
chainUrl https://rpc.elgafar-1.stargaze-apis.com/ The URL of the chain to use
registryAddress stars1n8kh8ev97f5ch2c5qtujlaelz9textg3t2tunu3emuv33d2jx9cs7mv9eq The contract address of the Andromeda Registry
addressPrefix stars The prefix for all addresses on chain
defaultFee 0.025ustars The default fee amount
blockExplorerTxPages https://testnet-explorer.publicawesome.dev/stargaze/tx/${txHash} URLs to block explorers for the given chain. Must include '${txHash}'
blockExplorerAddressPages https://testnet-explorer.publicawesome.dev/stargaze/account/${a… URLs to block explorers for the given chain. Must include '${txHash}'
chainType testnet The chain type
iconUrl [object Object]

Copy

Creates a copy of a current config.

Usage

chain copy <current config name/chainId> <new config name>

Example

? [email protected]> chain copy elgafar-1 test
Config loaded!
– Connecting client...
? [email protected]> chain list
Name Chain ID
uni3 uni-3
elgafar1 elgafar-1
galileo2 galileo-2
pisco1 pisco-1
test elgafar-1
When you copy a config, the wallets from the copied config are also copied to the new one.

Get

Gets the value for the specified key. The keys are the ones found above when we call chain config (chainId, chainUrl, ect...)

Usage

chain get <key>
If the <key> is not specified, then the entire config will be fetched.

Example

//Get the chainName of the chain
? [email protected]> chain get chainName
Current chain config
Key Value Description
chainName Stargaze The name of the chain

List

Lists all the saved configs.

Usage

chain list

Example

? [email protected]> chain list
Chain ID
uni-3
galileo-2
elgafar-1
The chain currently is use is highlighted in green.

New

Creates a new config.

Usage

chain new <name>

Example

? [email protected]> chain new tutorial
You will be prompted to enter the required config fields. We can then query the configs:
? [email protected]> chain list
Name Chain ID
uni3 uni-3
elgafar1 elgafar-1
galileo2 galileo-2
pisco1 pisco-1
tutorial elgafar-1

Remove

Removes a config by name or chain ID.
You can only remove configs that have been added and not default configs.

Usage

chain rm <config name>

Example

? [email protected]> chain rm copyofjuno
? Select new config to use: (Use arrow keys)
❯ junotestnet
elgafar1
galileo2
pisco1

Set

Sets the value for a given config key.
This command is disabled on the default chain configs since they are made to be immutable. Any new chain configs that are created or copied can use the command.

Usage

chain set <key> <value>

Example

Change some of the values in the config:
// Set the default fee to 0.03ujunox
? [email protected]> chain set defaultFee 0.03ujunox
Run chain config to see the changes in the config.

Use

Swaps to one of the saved configs.

Usage

chain use <chainId/name>

Example

// Get a list of chains saved. elgafar-1 is currently used.
? [email protected]> chain list
Name Chain ID
uni3 uni-3
elgafar1 elgafar-1
galileo2 galileo-2
pisco1 pisco-1
// Set pisco-1 as the config to use using the name.
? [email protected]> chain use pisco1
Config loaded!
- Connecting client...
? $pisco-1> ()
//Set galileo-2 as the config to use using the chainId.
? $pisco-1> chain use galileo-2
Config loaded!
– Connecting client...

CLI Configs

The default configs are saved in our GraphQL server, and can be easily fetched by anyone:
The following configs are currently saved:
Chain
Config-Testnets
Andromeda
galileo-2
Juno
uni-5
Stargaze
elgafar-1
Terra-2
pisco-1
To query the configs from the GQL server visit https://andr-graphql.herokuapp.com/graphql then run the following query:
You can get all the configs from the CLI by running chain config.
query {
chainConfigs {
allConfigs {
addressPrefix
blockExplorerAddressPages
blockExplorerTxPages
chainId
chainName
chainType
chainUrl
defaultFee
iconUrls {
lg
sm
}
name
registryAddress
}
}
}