Basic CLI Command
SIX CLI and SIX Protocol chain are building on cosmos-sdk then all basic command and flags of command pretty much the similar to cli of other chain.
Basic Command
# Point the six-testnet rpc endpoint
--node https://rpc1.fivenet.sixprotocol.net:443
# Point the six-mainnet endpoint
--node https://sixnet-rpc.sixprotocol.net:443
# Specify who is signing message
--from <address>
# Specify where can we get the private key to sign // os means local os device
--keyring-backend=os
# Gas limit to set per-transaction
--gas auto
# Adjustment factor to be multiplied against the estimate returned by the tx simulation
--gas-adjustment
# Gas prices in decimal format to determine the transaction fee
--gas-prices
# Skip tx broadcasting prompt confirmation
-y
You can start using cli by typing 'sixd -h' or 'sixd --help' to list the common available commands of sixd. It will show the results.
You can list other available child options by using -h or --help.
such as ‘sixd query -h’
Create Account
To create a fresh new account on SIX Protocol, you can follow this example.
sixd keys add alice
# RESULT
- name: alice
type: local
address: 6x123456789012345678912344567890123456789
pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"SoMeThInGhUmAnDoNoTuNdErStAnD"}'
mnemonic: ""
**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 seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed seed
Important write this mnemonic phrase in a safe place. It is the only way to recover your account if you ever forget your password.
Keyring-backend
The private key of your address will be saved locally as a keyring file. There are three types of keyring files: test, os, and file.
The default keyring file will be saved as "test" and located at $home/.six/keyring-test.
The second option for saving the keyring file is 'file'. With this option, the keyring will be saved to $home/.six/keyring-file by default. However, you can save it to any path by using the following command:
sixd keys add alice --keyring-backend file --home <input_path>
# this step you have to enter your password for security
# when you trying to sign txs
Finally, we have the 'os' keyring file. This option binds your key to the device(s).
To use this option, change "keyring-backed" to "os".
sixd keys add alice --keyring-backend os
# this step you have to enter your password for security
# when you trying to sign txs
Query Command
Due to the large number of available query commands, we will provide examples of some commonly used commands.
Show all of your account
sixd keys list
# Result
- name: alice
type: local
address: 6x123456789012345678912344567890123456789
pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"SoMeThInGhUmAnDoNoTuNdErStAnD"}'
mnemonic: ""
You can put your own option like --keyring-backend
and --home
Query balances of your account
sixd q bank balances <adderss_6x> --node https://rpc1.fivenet.sixprotocol.net:443
## RESULT
balances: []
pagination:
next_key: null
total: "0"
Tip: You can check your balance by running a query like this.
sixd q bank balances $(sixd keys show -a alice --keyring-backend os) --node https://rpc1.fivenet.sixprotocol.net:443
Query your individual node reward
sixd q distribution rewards <your_address> <validator_address> \
--node https://rpc1.fivenet.sixprotocol.net:443
# example for fivnet
# sixd q distribution rewards 6x1pe9u6dx3s6tajag2qrnnexm3muh4dp7qdunvgd 6xvaloper13dwxflzhc3qlkcy9syfnhr8tu2kdvuavhzdf9f --node https://rpc1.fivenet.sixprotocol.net:443
Tx Command
Due to the large number of available tx commands, we will provide examples of some commonly used commands for perform transaction.
Sending token to another account
sixd tx bank send <sender_adress> <reciver_address> \
<amount> --chain-id fivenet \
--gas auto --gas-prices 1.25usix --gas-adjustment 1.5 \
--from <your_key> --node https://rpc1.fivenet.sixprotocol.net:443 -y
## EXAMPLE
sixd tx bank send $(sixd keys show -a alice) 6x10lf5hppazn0l7pxq2guv58g3w6sffqc7ra0u4a \
19000000usix --chain-id fivenet \
--gas auto --gas-prices 1.25usix --gas-adjustment 1.5 \
--from alice --node https://rpc1.fivenet.sixprotocol.net:443 -y
If you create an address with the keyring-backed os or file option, you may need to specify the keyring-backend.
## EXAMPLE
sixd tx bank send $(sixd keys show -a alice) 6x10lf5hppazn0l7pxq2guv58g3w6sffqc7ra0u4a 19000000usix --chain-id fivenet --gas auto --gas-prices 1.25usix --gas-adjustment 1.5 --from alice --node https://rpc1.fivenet.sixprotocol.net:443 --keyring-backed test -y
Sending token to EVM account (0x) [EVMxCosmos Transfer]
To use the SIX Protocol EVM with Metamask, you need to wrap your USIX tokens and send them to your EVM account. Please ensure that you have USIX tokens in your account before proceeding.
We provide 2 way to send token from Cosmos to EVM: Wrap and Send to EVM
and Send to EVM
Wrap and Send to EVM
sixd tx tokenmngr wrap-token <amount> <evm_adderss> \
--gas auto --gas-prices 1.25usix --gas-adjustment 1.5 \
--from <your_key> --chain-id fivenet \
--node https://rpc1.fivenet.sixprotocol.net:443 -y
# exmaple
# sixd tx tokenmngr wrap-token 150000000usix 0xB62ef83643A2F8c95dF78F694C6Bf480f5b786f2 --from alice --gas auto --gas-prices 1.25usix --gas-adjustment 1.5 --chain-id fivenet --node https://rpc1.fivenet.sixprotocol.net:443 -y
You can wrap tokens without sending them to anyone by not specifying a destination address or by inputting your 6x address as the destination.
sixd tx tokenmngr wrap-token 500000000usix --from alice --gas auto --gas-prices 1.25usix --gas-adjustment 1.5 --chain-id fivnet --node https://rpc1.fivenet.sixprotocol.net:443 -y
So then your usix token will convert to asix token.
Send to EVM
If you already have wrapped SIX token (asix) in your account, you can now send wrapped tokens to an EVM address.
sixd tx tokenmngr send-wrap-token <evm_address> 10000000000000000000asix \
--from <your_key> --chain-id fivenet \
--gas auto --gas-prices 1.25usix --gas-adjustment 1.5 \
--node https://rpc1.fivenet.sixprotocol.net:443 -y
# example
# sixd tx tokenmngr send-wrap-token 0xb90b75aC68C466Bde2a0BDDde7b86897c8FE7C36 10000000000000000000asix --from alice --chain-id fivenet --gas auto --gas-prices 1.25usix --gas-adjustment 1.5 --node https://rpc1.fivenet.sixprotocol.net:443 -y
Unwrap token (asix to usix)
converting your wrapped SIX Token (asix) to usix
sixd tx tokenmngr unwrap-token <amount(asix)> \
--from <your_key> --chain-id fivenet\
--gas auto --gas-prices 1.25usix --gas-adjustment 1.5 -y
# exmaple
sixd tx tokenmngr unwrap-token 25000000000000000000asix --from alice --gas auto --gas-prices 1.25usix --gas-adjustment 1.5 -y
Last updated