Useful commands

Note

For the Docker setup from the setup guide, you can replace liked by docker-compose run --rm liked-command to run the commands below.
Also, for most of the commands, you will need to specify the node endpoint and the chain ID, which could be done by adding --node tcp://liked-service:26657 --chain-id likecoin-mainnet-2 after the command.
We have also provided two Docker Compose commands for creating validator and voting: docker-compose run --rm create-validator [...other-params] and docker-compose run --rm vote [proposal-id] [yes|no|veto|abstain].

Auth

The auth module defines basic account logic like sequences.

Query: Account Info

Query account info, including account number and sequence.
1
liked query auth account [ADDRESS]
Copied!

Bank

The bank module mainly defines transfer of coins.

Transaction: Send

Send coins to recipient.
  • [COINS] should be formatted like 1000000000nanolike (1 LIKE in this example)
1
liked bank tx send [FROM_ADDRESS_OR_KEY_NAME] [TO_ADDRESS] [COINS]
Copied!

Query: Balances

Query the balance of an address.
1
liked query bank balances [ADDRESS]
Copied!

Staking related modules

There are a few modules related to staking: staking, mint, distribution, slashing.

Transaction: Create Validator

Create validator, so the node with the corresponding consensus key can start to validate blocks.
Others can then delegate to the validator to increase its voting power and receive block rewards and transaction fee as return.
1
liked tx staking create-validator [OPTIONS]
Copied!
See --help for available options.

Transaction: Edit Validator

Edit validator info, including moniker, description, identity, website and commission rate.
Commission rate modification is limited by the validators maximum commission rate and maximum commission change rate which are set when creating the validators.
1
liked tx staking edit-validator [OPTIONS]
Copied!
See --help for available options.

Transaction: Delegate

Delegate to a validator, increasing its voting power, collecting block rewards and transaction fee as return.
1
liked tx staking delegate [VALIDATOR_ADDRESS] --from [DELEGATOR_ADDRESS] [COINS] --chain-id [CHAIN_ID]
Copied!

Transaction: Redelegate

Move some delegations from one validator to another.
Unlike unbond, this action takes effect immediately and does not need to wait for unbond period.
However, user needs to wait for 3 weeks before the same redelegation can be redelegated again. For example, user delegated to A and then redelegated from A to B, then the user needs to wait for 3 weeks before redelegating from B to C.
1
liked tx staking redelegate [FROM_VALIDATOR_ADDRESS] [TO_VALIDATOR_ADDRESS] --from [DELEGATOR_ADDRESS] [COINS] --chain-id [CHAIN_ID]
Copied!

Transaction: Unbond

Take away some delegations from a validator.
The delegation will enter unbonding state, which is locked for unbond period (3 weeks) before moving back into available balance.
1
liked tx staking unbond [VALIDATOR_ADDRESS] --from [DELEGATOR_ADDRESS] [COINS] --chain-id [CHAIN_ID]
Copied!

Transaction: Withdraw Rewards

Get the accumulated rewards from a delegation. Can add the --commission flag to also withdraw validator's commission.
1
liked tx distribution withdraw-rewards [VALIDATOR_ADDRESS] --from [DELEGATOR_ADDRESS] [--commission] --chain-id [CHAIN_ID]
Copied!

Transaction: Withdraw All Rewards

Get the accumulated rewards from all delegations among different validators.
1
liked tx distribution withdraw-all-rewards --from [DELEGATOR_ADDRESS] --chain-id [CHAIN_ID]
Copied!

Transaction: Unjail

Unjail validator who got jailed because of downtime.
Note that validators who got jailed because of double signing cannot be unjailed.
1
liked tx slashing unjail
Copied!

Query: Delegations

Get current delegations info from a delegator.
1
liked query staking delegations [DELEGATOR_ADDRESS] --chain-id [CHAIN_ID]
Copied!

Query: Validators

Get current validators info.
1
liked query staking validators
Copied!

Query: Inflation

Get current inflation rate.
1
liked query mint inflation
Copied!

Query: Rewards

Get current rewards which are not yet withdrawn.
1
liked query distribution rewards [DELEGATOR_ADDRESS] --chain-id [CHAIN_ID] [OPTIONAL_VALIDATOR_ADDRESS]
Copied!

Governance

Transaction: Submit Proposal

Submit a governance proposal, open for deposits before getting into voting.
Proposal content can be supplied either by command arguments or a file.
1
liked tx gov submit-proposal [OPTIONS]
Copied!

Transaction: Deposit

Deposit into an open proposal for voting.
1
liked tx gov deposit [PROPOSAL_ID] [COINS]
Copied!

Transaction: Vote

Vote in a proposal.
1
liked tx gov vote [PROPOSAL_ID] [yes|no|abstain]
Copied!

Query: Proposals

Query proposals.
1
liked query gov proposals
Copied!

Query: Deposits

Query proposal deposits.
1
liked query gov deposits [PROPOSAL_ID]
Copied!

Query: Votes

Query proposal votes.
1
liked query gov votes [PROPOSAL_ID]
Copied!
Last modified 3mo ago