chain-maind
Last updated
Last updated
chain-maind
is the all-in-one command-line interface. It supports wallet management, funds transfer and staking operations.
You can get the latest chain-maind
binary here from the ;
Alternatively, you can install chain-maind
by
chain-maind
chain-maind
is bundled with the Cronos POS Chain code. After you have obtained the latest chain-maind
binary, run
There is also a -h, --help
command available
By default, your config and data are stored in the folder located at the ~/.chain-maind
directory.
Make sure you have backed up your wallet storage after creating the wallet or else your funds may be inaccessible in case of accident forever.
To specify the chain-maind config and data storage directory; you can add a global flag --home <directory>
Cronos POS Chain has different Chain ID to distinguish between devnet, testnet and mainnet . Accordingly, you should set up your chain-maind and use the correct configuration for the node you are connecting to. For example, you might create the following aliases and add the global --chain-id
flag, for example, crypto-org-chain-mainnet-1
is the chain-id for the Cronos POS Chain mainnet:
A list of commonly used flags of chain-maind is listed below:
--home
Directory for config and data
string
~/.chain-maind
--chain-id
Full Chain ID
String
---
--output
Output format
string
"text"
--keyring-backend
Select keyring's backend
os/file/test
os
A list of commonly used chain-maind
commands.
keys
tx
query
You may also add the flag -h, --help
on chain-maind [command]
to get more available commands and details.
chain-maind keys
First of all, you will need an address to store and spend your CRO.
keys add <wallet_name>
- Create a new keyYou can create a new key with the name Default
as in the following example: ::: details Example: Create a new address
The key comes with a "mnemonic phrase", which is serialized into a human-readable 24-word mnemonic. User can recover their associated addresses with the mnemonic phrase.
It is important that you keep the mnemonic for address secure, as there is no way to recover it. You would not be able to recover and access the funds in the wallet if you forget the mnemonic phrase.
keys add <key_name> --recover
- Restore existing key by seed phraseYou can restore an existing key with the mnemonic.
keys list
- List your keysMultiple keys can be created when needed. You can list all keys saved under the storage path.
keys show <key_name>
- Retrieve key informationYou can retrieve key information by its name:
keys delete <key_name>
- Delete a keyYou can delete a key in your storage path.
Make sure you have backed up the key mnemonic before removing any of your keys, as there will be no way to recover your key without the mnemonic.
keys export <key_name>
- Export private keysYou can export and backup your key by using the export
subcommand:
--keyring-backend
optionInteracting with a node requires a public-private key pair. Keyring is the place holding the keys. The keys can be stored in different locations with specified backend types.
os
backendThe default os
backend stores the keys in the operating system's credential sub-system, which are comfortable to most users, yet without compromising on security.
Here is a list of the corresponding password managers in different operating systems:
GNU/Linux:
file
backendThe file
backend stores the encrypted keys inside the app's configuration directory. A password entry is required every time a user accesses it, which may also occur multiple times of repeated password prompts in one single command.
test
backendThe test
backend is a password-less variation of the file
backend. It stores unencrypted keys inside the app's configuration directory. It should only be used in testing environments and never be used in production.
chain-maind tx
tx bank send
- Transfer operationTransfer operation involves the transfer of tokens between two addresses.
tx bank send <from_key_or_address> <to_address> <amount> <network_id>
]tx staking
- Staking operationsStaking operations involve the interaction between an address and a validator. It allows you to create a validator and lock/unlock funds for staking purposes.
tx staking delegate <validator-addr> <amount>
]To bond funds for staking, you can delegate funds to a validator by the delegate
command
tx staking unbond <validator-addr> <amount>
]On the other hand, we can create a Unbond
transaction to unbond the delegated funds
query bank balances
- Check your transferable balanceYou can check your transferable balance with the balances
command under the bank module.
tx staking create-validator
- Joining the network as a validatorAnyone who wishes to become a validator can submit a create-validator
transaction by
(TODO: details of each flag )
tx slashing unjail
- Unjail a validatorValidator could be punished and jailed due to network misbehaviour, for example, if we check the validator set:
After the jailing period has passed, one can broadcast a unjail
transaction to unjail the validator and resume its normal operations by
macOS (since Mac OS 8.6):
Windows: