Stratos-chain 'stchaincli' Commands(Part1)

This document is the first part that describes a summarized list of 'stchaincli' commands for Stratos-chain.

Overview

Hardware and Software Requirements

Unlike other projects, Stratos does not require expensive GPUs and high wattage power supplies, but if the node wants to obtain revenue, it needs to provide enough bandwidth and storage capacity to ensure the traffic on the node can reach the reward requirements. We recommend the following to run your node:

* CPU i5 4 cores
* 16GB memory
* 2TB hard disk
* 100M bandwidth

Software(tested version):

* Ubuntu 18.04+
* Go 1.16+ linux/amd64 (optional, if compile the binary with source code)

Get Connected to Stratos Chain Testnet

Please refer to stratos-chain-testnet to

Directory Structure

After the node has caught up to the latest block, your Stratos-chain Wallet has been created and fed with an amount of tokens, the $HOME directory should include the following directories and files.

.
├── ...
├── .stchaincli
├── stchaincli
├── .stchaind
├── stchaind
├── ...

By default, the two binary executable files stchaincli and stchaind as well as two directories .stchaincl and .stchaind have been saved or created in the $HOME folder. If you are not sure what is your$HOMEfolder, in terminal, use 'echo $HOME' to check. In the following instruction, we suppose you have entered the $HOMEfolder

$ echo $HOME
/home/<your login username>

.stchaincli contains the folder keyring-test-cosmos, which holds the wallet info and wallet address

.
└── keyring-test-cosmos
    ├── st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw.address
    └── wallet1.info

.stchaind contains config and data folders.

.
├── config
   ├── addrbook.json
   ├── app.toml
   ├── config.toml
   ├── genesis.json
   ├── node_key.json
   └── priv_validator_key.json
└── data
    ├── application.db
    ├── blockstore.db
    ├── cs.wal
    ├── evidence.db
    ├── priv_validator_state.json
    ├── state.db
    └── tx_index.db

In config folder:

  • addrbook.json stores peer addresses.

  • app.toml contains the default settings required for app.

  • config.toml contains various options pertaining to the stratos-chain configurations.

  • genesis.json defines the initial state upon genesis of stratos-chain.

  • node_key.json contains the node private key and should thus be kept secret.

  • priv_validator_key.json contains the validator address, public key and private key, and should thus be kept secret.

In data folder:

  • All *.db folders are Tendermint databases

  • Tendermint uses a write ahead log (WAL) for consensus

  • priv_validator_state.jsonholds the validator's state

'stchaincli' Commands

For ease of use, these commands have been classified by the following modules:

PART 1:

PART 2:

Global Flags

Each command has its specific flags as well as several global flags. The specific flags will be explained along with each command, while the global flags are summarized as the following that can be used for all stchaincli commands.

Global Flags(can be used for all stchaincli commands):
      --chain-id string   Chain ID of tendermint node
  -e, --encoding string   Binary encoding (hex|b64|btc) (default "hex")
      --home string       directory for config and data (default "$HOME/.stchaincli")
  -o, --output string     Output format (text|json) (default "text")
      --trace             print out full stack trace on errors

--chain-id the current chain-id may change when updating in testing phase . When it is applied, user needs to point out current chain-id which can be found on this page, right next to the search bar at the top of the page.

--home is the directory containing a node's account information. By default, node's account info is saved or created under $HOME/.stchaincli. In this case, user does not need to add --home flag in the commands. Otherwise, user has to use this flag to specify the path to the node's root directory(default '$HOME') explicitly if not using the default directory. In the following instruction, we suppose the node info has been installed or created under $HOME/.stchaincli and skip the --home flag. User can add it where applicable.

Bank Module

Transaction

-send

Create and sign a send transaction.

Usage:
  stchaincli tx send <from_key_or_address> <to_address> <amount> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for send
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation

  In testing phase, --keyring-backend="test"

Tx command:

    stchaincli tx send <from_key_or_address> <to_address> <amount> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx send st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua st1cgm26ke6q6c65p58ytxq3jputh5jxvwms82ehk 1000000ustos --chain-id=test-chain --keyring-backend=test --gas=auto
gas estimate: 339112
{"chain_id":"test-chain","account_number":"0","sequence":"4","fee":{"amount":[],"gas":"339112"},"msgs":[{"type":"cosmos-sdk/MsgSend","value":{"from_address":"st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua","to_address":"st1cgm26ke6q6c65p58ytxq3jputh5jxvwms82ehk","amount":[{"denom":"ustos","amount":"1000000"}]}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 86FEC5EB8895D5F5F63D95144B878071E6D38B146BA36C258CA63C1DDEA11CB2
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Distribution Module

Transactions

-withdraw-rewards

Withdraw rewards from a given delegation address and optionally withdraw validator's commission if the delegation address given is a validator operator.

Usage:
  stchaincli tx distribution withdraw-rewards <validator-addr> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --commission               also withdraw validator's commission
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for withdraw-rewards
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation

  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx distribution withdraw-rewards <validator-addr> --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx distribution withdraw-rewards stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"15","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgWithdrawDelegationReward","value":"delegator_address":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","validator_address":"stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: C92736046083751DE178D536CCFE92B3640077969747B242D620920A337B8A8A
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

-withdraw-all-rewards

Withdraw all delegation rewards for a delegator.

Usage:
  stchaincli tx distribution withdraw-all-rewards [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for withdraw-all-rewards
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --max-msgs int             Limit the number of messages per tx (0 for unlimited) (default 5)
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation

  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx distribution withdraw-all-rewards --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx distribution withdraw-all-rewards --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"16","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgWithdrawDelegationReward","value":"delegator_address":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","validator_address":"stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 294F64594EA4B6D608AE3E1C080E3C5363C1A2CA2FB0AD171517E8A0F0D7CD08
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

Queries

commission

Query validator commission rewards from delegators to that validator.

Usage:
  stchaincli query distribution commission <validator> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for commission
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

commission Example

Query command:

stchaincli query distribution commission <validator> --chain-id=<current chain-id> --height=<height>

Example:

$ ./stchaincli query distribution commission stvaloper1gtw399h9vfnekqsz3dg4n6mj0qgdpnh30x66xa --chain-id=test-chain-localnet --height=9765
- denom: ustos
  amount: "108168326038.353750000000000000"

rewards

Query all rewards earned by a delegator, optionally restrict to rewards from a single validator.

Usage:
  stchaincli query distribution rewards <delegator-addr> [<validator-addr> (optional)] [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for rewards
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

rewards Example

Query command:

stchaincli query distribution rewards <delegator-addr> --chain-id=<current chain-id> --height=<height>

Example:

$ ./stchaincli query distribution rewards st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --height=9765
rewards:
- validator_address: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
reward:
- denom: ustos
amount: "973479288285.393750000000000000"
total:
- denom: ustos
amount: "973479288285.393750000000000000"

validator-outstanding-rewards

Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations.

Usage:
  stchaincli query distribution validator-outstanding-rewards <validator> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for validator-outstanding-rewards
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

validator-outstanding-rewards Example

Query command:

stchaincli query distribution validator-outstanding-rewards <validator> --chain-id=<current chain-id> --height=<height>

Example:

$ ./stchaincli query distribution validator-outstanding-rewards stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --chain-id=test-chain-localnet --height=9765
- denom: ustos
  amount: "1081643653650.437500000000000000"

community-pool

Query all coins in the community pool which is under Governance control.

Usage:
  stchaincli query distribution community-pool [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for community-pool
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

community-pool Example

Query command:

stchaincli query distribution community-pool --chain-id=<current chain-id> --height=<height>

Example:

$ ./stchaincli query distribution community-pool --chain-id=test-chain-localnet --height=9765
- denom: ustos
  amount: "88300342740.300000000000000000"

slashes

Query all slashes of a validator for a given block range.

Usage:
  stchaincli query distribution slashes <validator> <start-height> <end-height> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for slashes
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

slashes Example

Query command:

stchaincli query distribution slashes <validator> <start-height> <end-height> --chain-id=<current chain-id>

Example:

$ ./stchaincli query distribution slashes stvaloper1095s2f3m60qz48spy3wr52gw8xmy7xqywnxnrq 0 5000 --chain-id=test-chain-localnet
- validator_period: 2
  fraction: "0.009900000099000001"

distribution-params

Query distribution params.

Usage:
  stchaincli query distribution params [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for params
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

params Example

Query command:

 stchaincli query distribution params --chain-id=<current chain-id>

Example:

$ ./stchaincli query distribution params --chain-id=test-chain-localnet
    community_tax: "0.020000000000000000"
    base_proposer_reward: "0.010000000000000000"
    bonus_proposer_reward: "0.040000000000000000"
    withdraw_addr_enabled: true


Gov Module

Transactions

-submit-proposal

Submit a proposal along with an initial deposit. Proposal title, description, type and deposit can be given directly or through a proposal JSON file.

Except for itself, the command submit-proposal also provides three sub-commands, param-change, community-pool-spend and software-upgrade, to submit a proposal for changing global parameters, distributing funds in community-pool and upgrading software.

Usage:
  stchaincli tx gov submit-proposal [flags]
  stchaincli tx gov submit-proposal [command]

Available Commands:
  param-change         Submit a parameter change proposal
  community-pool-spend Submit a community pool spend proposal
  software-upgrade     Submit a software upgrade proposal

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --deposit string           deposit of proposal
      --description string       description of proposal
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for submit-proposal
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --proposal string          proposal file path (if this path is given, other proposal flags are ignored)
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --title string             title of proposal
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
      --type string              proposalType of proposal, types: text/parameter_change/software_upgrade
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

submit-proposal Example

stchaincli tx gov submit-proposal <proposal.json> --from=<Name|address of private key>

Where proposal.json contains:

    {
      "title": "Test Proposal",
      "description": "My awesome proposal",
      "type": "Text",
      "deposit": "100000000000ustos"
    }

equivalent to:

stchaincli tx gov submit-proposal --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="100000000000ustos" --from=<name|address of private key>

submit-proposal Tx command:

stchaincli tx gov submit-proposal --title=<title> --description=<description> --type=<type> --deposit=<amount> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx gov submit-proposal --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="100000000000ustos" --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"17","fee":{"amount":[],"gas":"200000"},
    "msgs":[{"type":"cosmos-sdk/MsgSubmitProposal","value":{"content":{"type":"cosmos-sdk/TextProposal",
    "value":{"title":"Test Proposal","description":"My awesome proposal"}},"initial_deposit":[{"denom":"ustos","amount":"100000000000"}],
    "proposer":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 3AFD20D0B32674439784262C17ACF10D23ABA77E88F351128B927B9BC9A36DFC
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

param-change Example

Submit a parameter proposal along with an initial deposit. The proposal details must be supplied via a JSON file. For values that contains objects, only non-empty fields will be updated.

Usage:
  stchaincli tx gov submit-proposal param-change <proposal-file> [flags]

param-change tx command:

stchaincli tx gov submit-proposal param-change <proposal-file> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Suppose we need to change the MaxValidators in staking Module, so the param_change.json could be:

    {
      "title": "Param-Change Staking MaxValidators to 100",
      "description": "This is a test to update MaxValidators to 100 in staking Module",
      "changes": [
        {
          "subspace": "staking",
          "key": "MaxValidators",
          "value": 100
        }
      ],
      "deposit": [
        {
          "denom": "ustos",
          "amount": "1000000000000"
        }
      ]
    }

Example:

$ ./stchaincli tx gov submit-proposal param-change ./helpers/param_change.json --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"12","fee":{"amount":[],"gas":"200000"},
    "msgs":[{"type":"cosmos-sdk/MsgSubmitProposal","value":{"content":{"type":"cosmos-sdk/ParameterChangeProposal",
    "value":{"title":"Param-Change Staking MaxValidators to 100","description":"This is a test to update MaxValidators to 100 in staking Module",
    "changes":[{"subspace":"staking","key":"MaxValidators","value":"100"}]}},"initial_deposit":[{"denom":"ustos","amount":"1000000000000"}],
    "proposer":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 109218F2DF23FCF61E3A6139AADBF87E07BDAA5953C753CAEB640184428C8397
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

community-pool-spend Example

Submit a community pool spend proposal along with an initial deposit. The proposal details must be supplied via a JSON file.

Usage:
  stchaincli tx gov submit-proposal community-pool-spend <proposal-file> [flags]

community-pool-spend tx command:

stchaincli tx gov submit-proposal community-pool-spend <proposal-file> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

The proposal.json could be:

    {
      "title": "Community Pool Spend",
      "description": "Pay me some STOSes!",
      "recipient": "st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda",
      "amount": [
        {
          "denom": "ustos",
          "amount": "1000000000000"
        }
      ],
      "deposit": [
        {
          "denom": "ustos",
          "amount": "1000000000000"
        }
      ]
    }

Example:

$ ./stchaincli tx gov submit-proposal community-pool-spend ./helpers/proposal.json --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"18","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgSubmitProposal",
    "value":{"content":{"type":"cosmos-sdk/CommunityPoolSpendProposal","value":{"title":"Community Pool Spend","description":"Pay me some STOSes!",
    "recipient":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","amount":[{"denom":"ustos","amount":"1000000000000"}]}},
    "initial_deposit":[{"denom":"ustos","amount":"1000000000000"}],"proposer":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 27618F2DB94E91BD9402595D931FDA834E56EB02541BEDF0268A63A85C7D2403
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

software-upgrade Example

Submit a software upgrade along with an initial deposit.

Usage:
  stchaincli tx gov submit-proposal software-upgrade <name> (--upgrade-height [height] | --upgrade-time [time]) (--upgrade-info [info]) [flags]

software-upgrade tx command:

stchaincli tx gov submit-proposal software-upgrade="v0.3.1" --upgrade-height=1000 --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --description=test1 --title=test1 --deposit=100000000000ustos --info=testinfo --chain-id=test-chain-localnet --keyring-backend=test --gas=auto

-deposit

Deposit tokens for an active proposal by proposal-id which can be found with the command stchaincli query gov proposals.

Usage:
  stchaincli tx gov deposit <proposal-id> <deposit> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for deposit
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx gov deposit <proposal-id> <deposit> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx gov deposit 7 100000000ustos --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"21","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgDeposit",
    "value":{"proposal_id":"7","depositor":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","amount":[{"denom":"ustos","amount":"100000000"}]}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: CCC6A5BC463CA75533471A9DDCCC60CEE876D665B268861DEFE80D009DD668C7
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

-vote

Submit a vote for an active proposal. Vote options include yes/no/no_with_veto/abstain.

Usage:
    stchaincli tx gov vote <proposal-id> <option> [flags] --from [key/address]

Flags:
    -a, --account-number uint      The account number of the signing account (offline mode only)
    -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
    --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
    --fees string              Fees to pay along with transaction; eg: 10ustos
    --from string              Name or address of private key with which to sign
    --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
    --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
    --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
    --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
    -h, --help                     help for vote
    --indent                   Add indent to JSON response
    --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
    --ledger                   Use a connected Ledger device
    --memo string              Memo to send along with transaction
    --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
    -s, --sequence uint            The sequence number of the signing account (offline mode only)
    --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
    -y, --yes                      Skip tx broadcasting prompt confirmation
    
    In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx gov vote <proposal-id> <option> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx gov vote 7 yes --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"22","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgVote",
    "value":{"proposal_id":"7","voter":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","option":"Yes"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 49BD8E49651EB0976E6FC364A9F611A16C3146922D42E64144DC0DE4F45FA3D5
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

Queries

proposal

Query details for a proposal. You can find the proposal-id by running ./stchaincli query gov proposals

Usage:
  stchaincli query gov proposal <proposal-id> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for proposal
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query gov proposal <proposal-id> --chain-id=<current chain-id>

Example:

$ ./stchaincli query gov proposal 7 --chain-id=test-chain-localnet
    content:
      title: Param-Change Staking MaxValidators to 100
      description: This is a test to update MaxValidators to 100 in staking Module
      changes:
      - subspace: staking
        key: MaxValidators
        value: "100"
    id: 7
    proposal_status: 3
    final_tally_result:
      "yes": "400000000"
      abstain: "0"
      "no": "0"
      no_with_veto: "0"
    submit_time: 2021-07-23T14:40:04.976927421Z
    deposit_end_time: 2021-07-23T14:41:44.976927421Z
    total_deposit:
    - denom: ustos
      amount: "100010000"
    voting_start_time: 2021-07-23T14:40:41.961523583Z
    voting_end_time: 2021-07-23T14:42:21.961523583Z

proposals

Query details of all proposals with optional filters(flags).

Usage:
  stchaincli query gov proposals [flags]

Flags:
      --depositor string   (optional) filter by proposals deposited on by depositor
      --height int         Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help               help for proposals
      --indent             Add indent to JSON response
      --ledger             Use a connected Ledger device
      --limit int          pagination limit of proposals to query for (default 100)
      --node string        <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --page int           pagination page of proposals to to query for (default 1)
      --status string      (optional) filter proposals by proposal status, status: deposit_period/voting_period/passed/rejected
      --trust-node         Trust connected full node (don't verify proofs for responses)
      --voter string       (optional) filter by proposals voted on by voted

Example:
    stchaincli query gov proposals --depositor st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
    stchaincli query gov proposals --voter st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
    stchaincli query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected)
    stchaincli query gov proposals --page=2 --limit=100

Query command:

stchaincli query gov proposals --chain-id=<current chain-id>

Example:

$ ./stchaincli query gov proposals --chain-id=test-chain-localnet
    - content:
        title: Param-Change Staking MaxValidators to 5
        description: This is a test to update MaxValidators to 5 in staking Module
        changes:
        - subspace: staking
          key: MaxValidators
          value: "5"
      id: 1
      proposal_status: 3
      final_tally_result:
        "yes": "383333332"
        abstain: "0"
        "no": "0"
        no_with_veto: "0"
      submit_time: 2021-07-19T15:38:08.619640056Z
      deposit_end_time: 2021-07-19T15:39:48.619640056Z
      total_deposit:
      - denom: ustos
        amount: "100010000"
      voting_start_time: 2021-07-19T15:38:23.789218262Z
      voting_end_time: 2021-07-19T15:40:03.789218262Z

    ...

    - content:
        title: Param-Change Staking MaxValidators to 100
        description: This is a test to update MaxValidators to 100 in staking Module
        changes:
        - subspace: staking
          key: MaxValidators
          value: "100"
      id: 7
      proposal_status: 3
      final_tally_result:
        "yes": "400000000"
        abstain: "0"
        "no": "0"
        no_with_veto: "0"
      submit_time: 2021-07-23T14:40:04.976927421Z
      deposit_end_time: 2021-07-23T14:41:44.976927421Z
      total_deposit:
      - denom: ustos
        amount: "100010000"
      voting_start_time: 2021-07-23T14:40:41.961523583Z
      voting_end_time: 2021-07-23T14:42:21.961523583Z

vote

Query details for a single vote on a proposal given its identifier.

Usage:
  stchaincli query gov vote <proposal-id> <voter-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for vote
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query gov vote <proposal-id> <voter-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query gov vote 7 st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet
    proposal_id: 7
    voter: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
    option: 1

votes

Query vote details for a single proposal by its identifier.

Usage:
  stchaincli query gov votes <proposal-id> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for votes
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --limit int     pagination limit of votes to query for (default 100)
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --page int      pagination page of votes to to query for (default 1)
      --trust-node    Trust connected full node (don't verify proofs for response

Query command:

stchaincli query gov votes <proposal-id> --chain-id=<current chain-id>

Example:

$ ./stchaincli query gov votes 7 --chain-id=test-chain-localnet
    - proposal_id: 7
      voter: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
      option: 1
    - proposal_id: 7
      voter: st1m4f4hnyfhpaeqlcgv7lfhgzjwmrvfeggwnpygz
      option: 1
    - proposal_id: 7
      voter: st1kuhyf59qvukk8r5manky062d6c66utvytm7az6
      option: 1
    - proposal_id: 7
      voter: st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k
      option: 1

deposit

Query details for a single proposal deposit on a proposal by its identifier.

Usage:
  stchaincli query gov deposit <proposal-id> <depositer-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for deposit
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query gov deposit <proposal-id> <depositer-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query gov deposit 7 st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet
proposal_id: 7
depositor: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
amount:
- denom: ustos
  amount: "100000000"

deposits

Query details for all deposits on a proposal.

Usage:
  stchaincli query gov deposits <proposal-id> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for deposits
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query gov deposits <proposal-id> --chain-id=<current chain-id>

Example:

$ ./stchaincli query gov deposits 7 --chain-id=test-chain-localnet
    - proposal_id: 7
      depositor: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
      amount:
      - denom: ustos
        amount: "100000000"

Slashing Module

Transaction

-unjail

Unjail a jailed validator.

Usage:
  stchaincli tx slashing unjail [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for unjail
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx slashing unjail --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx slashing unjail --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"27","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgUnjail",
    "value":{"address":"stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k"}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 911A6B5A76F28EFBCA9C5ABD687191DB9F4801419EC5B803565265E018AB0D99
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

Queries

signing-info

Use a validators' consensus public key to find the signing-info for that validator.

Usage:
  stchaincli query slashing signing-info <validator-conspub> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for signing-info
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query slashing signing-info <validator-conspub> --chain-id=<current chain-id>

Example:

$ ./stchaincli query slashing signing-info stvalconspub1zcjduepqsnwlx7rv0ghyvh9tm99zle39df99jt8hccwt8jdrvjs26zqrzh9shdmgyc --chain-id=test-chain-localnet
    address: stvalcons1sa58sznp26ftquypx994q2eurq6qy38tfm3rn3
    start_height: 0
    index_offset: 3874
    jailed_until: 1970-01-01T00:00:00Z
    tombstoned: false
    missed_blocks_counter: 0

slashing-params

Query genesis parameters for the slashing module.

Usage:
  stchaincli query slashing params [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for params
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query slashing params --chain-id=<current chain-id>

Example:

$ ./stchaincli query slashing params --chain-id=test-chain-localnet
signed_blocks_window: 10000
min_signed_per_window: "0.500000000000000000"
downtime_jail_duration: 10m0s
slash_fraction_double_sign: "0.050000000000000000"
slash_fraction_downtime: "0.010000000000000000"

Staking Module

Transactions

-delegate

Delegate an amount of liquid coins to a validator from your wallet.

Usage:
  stchaincli tx staking delegate <validator-addr> <amount> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for delegate
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx staking delegate <validator-addr> <amount> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx staking delegate stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k 1000ustos --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"25","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgDelegate",
    "value":{"delegator_address":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","validator_address":"stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k",
    "amount":{"denom":"ustos","amount":"1000"}}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 1977A5421CBB956849D27AC46A0B7CED33CC156781384018DC4E6B295A6CFBB6
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

-redelegate

Redelegate an amount of illiquid staking tokens from one validator to another.

Usage:
  stchaincli tx staking redelegate <src-validator-addr> <dst-validator-addr> <amount> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for redelegate
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx staking redelegate <src-validator-addr> <dst-validator-addr> <amount> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx staking redelegate stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k stvaloper1gtw399h9vfnekqsz3dg4n6mj0qgdpnh30x66xa 1000ustos --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
    {"chain_id":"test-chain-localnet","account_number":"0","sequence":"26","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgBeginRedelegate",
    "value":{"delegator_address":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda","validator_src_address":"stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k",
    "validator_dst_address":"stvaloper1gtw399h9vfnekqsz3dg4n6mj0qgdpnh30x66xa","amount":{"denom":"ustos","amount":"1000"}}}],"memo":""}

    confirm transaction before signing and broadcasting [y/N]: y
    height: 0
    txhash: 84FB5E7F633576B55A5A6A7870324F03DF5604F8D08BCFA5DF4F838CFA90E003
    codespace: ""
    code: 0
    data: ""
    rawlog: '[]'
    logs: []
    info: ""
    gaswanted: 0
    gasused: 0
    tx: null
    timestamp: ""

-unbond

Unbond an amount of bonded shares from a validator.

Usage:
  stchaincli tx staking unbond <validator-addr> <amount> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for unbond
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx staking unbond <validator-addr> <amount> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --gas=auto

Example:

$ ./stchaincli tx staking unbond stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u 10000ustos --from=st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh --keyring-backend=test --chain-id=test-chain-localnet --gas=auto
{"chain_id":"test-chain-localnet","account_number":"0","sequence":"4","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgUndelegate",
"value":{"delegator_address":"st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh","validator_address":"stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u",
"amount":{"denom":"ustos","amount":"10000"}}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 7E7FF7B80C8883FC945BE6EF6CB0A26DB3CE5927AB29D7380AC46C38790B927F
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

-create-validator

Create new validator initialized with a self-delegation to it.

Usage:
  stchaincli tx staking create-validator [flags]

Flags:
  -a, --account-number uint                 The account number of the signing account (offline mode only)
      --amount string                       Amount of coins to bond
  -b, --broadcast-mode string               Transaction broadcasting mode (sync|async|block) (default "sync")
      --commission-max-change-rate string   The maximum commission change rate percentage (per day)
      --commission-max-rate string          The maximum commission rate percentage
      --commission-rate string              The initial commission rate percentage
      --details string                      The validator's (optional) details
      --dry-run                             ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string                         Fees to pay along with transaction; eg: 10ustos
      --from string                         Name or address of private key with which to sign
      --gas string                          gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float                adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string                   Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only                       Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                                help for create-validator
      --identity string                     The optional identity signature (ex. UPort or Keybase)
      --indent                              Add indent to JSON response
      --ip string                           The node's public IP. It takes effect only when used in combination with --generate-only
      --keyring-backend string              Select keyring's backend (os|file|test) (default "os")
      --ledger                              Use a connected Ledger device
      --memo string                         Memo to send along with transaction
      --min-self-delegation string          The minimum self delegation required on the validator
      --moniker string                      The validator's name
      --node string                         <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --node-id string                      The node's ID
      --pubkey string                       The Bech32 encoded PubKey of the validator
      --security-contact string             The validator's (optional) security contact email
  -s, --sequence uint                       The sequence number of the signing account (offline mode only)
      --trust-node                          Trust connected full node (don't verify proofs for responses) (default true)
      --website string                      The validator's (optional) website
  -y, --yes                                 Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"
  • moniker: the validator's name

  • pubkey: the private key associated with this Tendermint PubKey is used to sign prevotes and precommits

  • website: website(Optional)

  • description: description(Optional)

  • commission-rate: the commission rate on block rewards and fees charged to delegators

  • commission-max-rate: the maximum commission rate which this validator can charge. This parameter cannot be changed after create-validator is processed.

  • commission-max-change-rate: the maximum daily increase of the validator commission. This parameter cannot be changed after create-validator is processed.

  • min-self-delegation: minimum amount of tokens the validator needs to have bonded at all time. If the validator's self-delegated stake falls below this limit, their entire staking pool will unbond. "1" = 1000000ustos

  • amount: the amount of tokens to be bond to the validator at creation. This value should be greater than the value of min-self-delegation * 1000000

Tx command:

stchaincli tx staking create-validator --amount=<amount> --pubkey=<validator pubkey> --moniker=<validator name> --commission-rate=<initial commission rate> --commission-max-rate=<maximum commission rate> --commission-max-change-rate=<maximum commission change rate> --min-self-delegation=<min-self-delegation, "1"=1000000ustos> --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'>  --gas=auto

Example:

$ ./stchaincli tx staking create-validator --amount=100000000000ustos --pubkey=stvalconspub1zcjduepq6h2yq5fgtx4c86jhk6r568shy725q833hr02dkfcfhsu30zvjuksr4cdwl --moniker="node4" --commission-rate=0.10 --commission-max-rate=0.20 --commission-max-change-rate=0.01 --min-self-delegation=1 --from=st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76 --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
{"chain_id":"test-chain-localnet","account_number":"10","sequence":"0","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"description":{"moniker":"node4","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1000000","delegator_address":"st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76","validator_address":"stvaloper15xlpwafgnvvs5hdk8938dp2ve6cjmy4v09ulz3","pubkey":"stvalconspub1zcjduepq6h2yq5fgtx4c86jhk6r568shy725q833hr02dkfcfhsu30zvjuksr4cdwl","value":{"denom":"ustos","amount":"100000000000"}}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: D0521584DC410863B6662C6531C03B3B4C9E0E2B278FD238DD42EA0BBBCC42D3
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

-edit-validator

Edit an existing validator account.

UUsage:
  stchaincli tx staking edit-validator [flags]

Flags:
  -a, --account-number uint          The account number of the signing account (offline mode only)
  -b, --broadcast-mode string        Transaction broadcasting mode (sync|async|block) (default "sync")
      --commission-rate string       The new commission rate percentage
      --details string               The validator's (optional) details (default "[do-not-modify]")
      --dry-run                      ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string                  Fees to pay along with transaction; eg: 10ustos
      --from string                  Name or address of private key with which to sign
      --gas string                   gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float         adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string            Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only                Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                         help for edit-validator
      --identity string              The (optional) identity signature (ex. UPort or Keybase) (default "[do-not-modify]")
      --indent                       Add indent to JSON response
      --keyring-backend string       Select keyring's backend (os|file|test) (default "os")
      --ledger                       Use a connected Ledger device
      --memo string                  Memo to send along with transaction
      --min-self-delegation string   The minimum self delegation required on the validator
      --moniker string               The validator's name (default "[do-not-modify]")
      --node string                  <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --security-contact string      The validator's (optional) security contact email (default "[do-not-modify]")
  -s, --sequence uint                The sequence number of the signing account (offline mode only)
      --trust-node                   Trust connected full node (don't verify proofs for responses) (default true)
      --website string               The validator's (optional) website (default "[do-not-modify]")
  -y, --yes                          Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx staking edit-validator  --from=<name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend'> --min-self-delegation=<value of min-self-delegation, increase only> --memo=<description> --gas=auto

Example:

$ ./stchaincli tx staking edit-validator --from=st1gamc7ajhzukp08nle9z9asyfx4u4dlz5xpfu7e --chain-id=test-chain-localnet --keyring-backend=test --min-self-delegation=100  --memo="Change 'min-self-delegation' from 1 to 100" --gas=auto
{"chain_id":"test-chain-localnet","account_number":"1","sequence":"1","fee":{"amount":[],"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgEditValidator",
"value":{"description":{"moniker":"[do-not-modify]","identity":"[do-not-modify]","website":"[do-not-modify]",
"security_contact":"[do-not-modify]","details":"[do-not-modify]"},"address":"stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj",
"commission_rate":null,"min_self_delegation":"100"}}],"memo":"Change 'min-self-delegation' from 1 to 100"}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 13CC85397AC6715830E027F7477480FA72377306BD529886BB8E6607FFC243E7
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

min_self_delegation allows to increase only

commission-max-rate cannot be changed after create-validator

commission-max-change-ratecannot be changed after create-validator

Queries

delegation

Query a delegation based on delegator address and validator address.

Usage:
  stchaincli query staking delegation <delegator-addr> <validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for delegation
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking delegation <delegator-addr> <validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking delegation st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --chain-id=test-chain-localnet
    delegation:
      delegator_address: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
      validator_address: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
      shares: "100000000.000000000000000000"
    balance:
      denom: ustos
      amount: "100000000"

delegations

Query delegations for an individual delegator on all validators.

Usage:
  stchaincli query staking delegations <delegator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for delegations
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking delegations <delegator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking delegations st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet
    - delegation:
        delegator_address: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
        validator_address: stvaloper1gtw399h9vfnekqsz3dg4n6mj0qgdpnh30x66xa
        shares: "1000.000000000000000000"
      balance:
        denom: ustos
        amount: "1000"
    - delegation:
        delegator_address: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
        validator_address: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
        shares: "100000000.000000000000000000"
      balance:
        denom: ustos
        amount: "100000000"

delegations-to

Query all delegations made to one validator.

Usage:
  stchaincli query staking delegations-to <validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for delegations-to
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking delegations-to <validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking delegations-to stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p --chain-id=test-chain
- delegation:
    delegator_address: st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2
    validator_address: stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p
    shares: "500000000000.000000000000000000"
  balance:
    denom: ustos
    amount: "500000000000"

unbonding-delegations

Query unbonding delegations for an individual delegator.

Usage:
  stchaincli query staking unbonding-delegations <delegator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for unbonding-delegations
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking unbonding-delegations <delegator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli q staking unbonding-delegations st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2 --chain-id=test-chain
- delegator_address: st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2
  validator_address: stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p
  entries:
  - creation_height: 5805
    completion_time: 2021-08-30T19:53:31.144199109Z
    initial_balance: "10000"
    balance: "10000"

unbonding-delegation

Query unbonding delegations for an individual delegator on an individual validator.

Usage:
  stchaincli query staking unbonding-delegation <delegator-addr> <validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for unbonding-delegation
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Cosmos SDK has reported a bug on this query command

// Line #383 in 'github.com/cosmos/cosmos-sdk/blob/v0.39.2/x/staking/client/cli/query.go'
return cliCtx.PrintOutput(types.MustUnmarshalUBD(cdc, res))
This line must execute unmarshalJSON not MustUnmarshalUBD.

Please refer to here and here for more details.

Query command:

stchaincli q staking unbonding-delegation <delegator-addr> <validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli q staking unbonding-delegation st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2 stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p --chain-id=test-chain
panic: Bytes left over in UnmarshalBinaryLengthPrefixed, should read 123 more bytes but have 327

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/x/staking/types.MustUnmarshalUBD(0xc000b99dc0, 0xc0000e4160, 0x148, 0x14a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/vendor/github.com/cosmos/cosmos-sdk/x/staking/types/delegation.go:175 +0x170
github.com/cosmos/cosmos-sdk/x/staking/client/cli.GetCmdQueryUnbondingDelegation.func1(0xc000e882c0, 0xc000ea6e40, 0x2, 0x4, 0x0, 0x0)
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/vendor/github.com/cosmos/cosmos-sdk/x/staking/client/cli/query.go:383 +0x405
github.com/spf13/cobra.(*Command).execute(0xc000e882c0, 0xc000ea6e00, 0x4, 0x4, 0xc000e882c0, 0xc000ea6e00)
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/vendor/github.com/spf13/cobra/command.go:842 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001798c0, 0x8ba405, 0xc0001798c0, 0x115bf25)
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/vendor/github.com/spf13/cobra/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/vendor/github.com/spf13/cobra/command.go:887
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc0001798c0, 0x135fc38, 0x2, 0xc000e513c0)
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/vendor/github.com/tendermint/tendermint/libs/cli/setup.go:89 +0x3c
main.main()
        /mnt/hgfs/code/multinode_dev/allow-ed25519-gas/stratos-chain/cmd/stchaincli/main.go:75 +0x34e

unbonding-delegations-from

Query all unbonding delegatations from a validator.

Usage:
  stchaincli query staking unbonding-delegations-from <validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for unbonding-delegations-from
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking unbonding-delegations-from <validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking unbonding-delegations-from stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p --chain-id=test-chain
- delegator_address: st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2
  validator_address: stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p
  entries:
  - creation_height: 5805
    completion_time: 2021-08-30T19:53:31.144199109Z
    initial_balance: "10000"
    balance: "10000"

redelegation

Query a redelegation record based on delegator and a source and destination validator address.

Usage:
  stchaincli query staking redelegation <delegator-addr> <src-validator-addr> <dst-validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for redelegation
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking redelegation <delegator-addr> <src-validator-addr> <dst-validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking redelegation st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76 stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq  --chain-id=test-chain-localnet
- redelegation:
    delegator_address: st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76
    validator_src_address: stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj
    validator_dst_address: stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq
    entries: []
  entries:
  - redelegationentry:
      creation_height: 1909
      completion_time: 2021-09-02T19:33:26.890343914Z
      initial_balance: "10000"
      shares_dst: "10000.000000000000000000"
    balance: "10000"

redelegations

Query all redelegations records for one delegator.

Usage:
  stchaincli query staking redelegations <delegator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for redelegations
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking redelegations <delegator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking redelegations st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76 --chain-id=test-chain-localnet
- redelegation:
    delegator_address: st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76
    validator_src_address: stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj
    validator_dst_address: stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq
    entries: []
  entries:
  - redelegationentry:
      creation_height: 1909
      completion_time: 2021-09-02T19:33:26.890343914Z
      initial_balance: "10000"
      shares_dst: "10000.000000000000000000"
    balance: "10000"

redelegations-from

Query all unbonding delegations from a validator.

Usage:
  stchaincli query staking unbonding-delegations-from <validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for unbonding-delegations-from
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking unbonding-delegations-from <validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking unbonding-delegations-from stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p --chain-id=test-chain
- delegator_address: st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2
  validator_address: stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p
  entries:
  - creation_height: 5805
    completion_time: 2021-08-30T19:53:31.144199109Z
    initial_balance: "10000"
    balance: "10000"

historical-info

Query historical info at given height.

Usage:
  stchaincli query staking historical-info <height> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for historical-info
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Example

- Note:
- The response of `historical-info` is depended on the `skating` parameter `HistoricalEntries`. If `HistoricalEntries` is "0", the response will always be

ERROR: no historical info found

When the skating parameters are the following, for example

root@ubuntu:/stratos-chain$ ./build/stchaincli query staking params --trust-node
unbonding_time: 504h0m0s
max_validators: 100
max_entries: 7
historical_entries: 0
bond_denom: ustos

Query command:

./stchaincli query staking historical-info <height> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking historical-info 6733 --chain-id=test-chain
header:
  version:
    block: 10
    app: 0
    xxx_nounkeyedliteral: {}
    xxx_unrecognized: []
    xxx_sizecache: 0
  chainid: test-chain
  height: 6733
  time: 2021-08-10T20:22:03.873954276Z
  lastblockid:
    hash:
    - 114
    - 239
    - 25
    - 44
    - 155
    - 111
    - 75
    - 96
    - 33
    - 199
    - 140
    - 248
    - 226
    - 120
    - 4
    - 236
    - 97
    - 209
    - 111
    - 121
    - 228
    - 136
    - 101
    - 90
    - 39
    - 64
    - 14
    - 236
    - 219
    - 186
    - 88
    - 39
    partsheader:
      total: 1
      hash:
      - 169
      - 220
      - 192
      - 255
      - 35
      - 244
      - 180
      - 251
      - 127
      - 206
      - 77
      - 60
      - 12
      - 152
      - 85
      - 8
      - 254
      - 190
      - 83
      - 127
      - 247
      - 117
      - 84
      - 210
      - 114
      - 15
      - 47
      - 93
      - 15
      - 148
      - 68
      - 114
      xxx_nounkeyedliteral: {}
      xxx_unrecognized: []
      xxx_sizecache: 0
    xxx_nounkeyedliteral: {}
    xxx_unrecognized: []
    xxx_sizecache: 0
  lastcommithash:
  - 46
  - 234
  - 204
  - 0
  - 199
  - 235
  - 16
  - 141
  - 73
  - 96
  - 199
  - 38
  - 137
  - 118
  - 161
  - 131
  - 80
  - 27
  - 27
  - 185
  - 224
  - 222
  - 97
  - 26
  - 108
  - 243
  - 203
  - 223
  - 52
  - 131
  - 227
  - 237
  datahash: []
  validatorshash:
  - 70
  - 218
  - 149
  - 103
  - 42
  - 219
  - 176
  - 153
  - 48
  - 82
  - 25
  - 251
  - 28
  - 43
  - 74
  - 7
  - 165
  - 54
  - 152
  - 79
  - 148
  - 185
  - 253
  - 128
  - 13
  - 224
  - 227
  - 33
  - 110
  - 211
  - 117
  - 229
  nextvalidatorshash:
  - 70
  - 218
  - 149
  - 103
  - 42
  - 219
  - 176
  - 153
  - 48
  - 82
  - 25
  - 251
  - 28
  - 43
  - 74
  - 7
  - 165
  - 54
  - 152
  - 79
  - 148
  - 185
  - 253
  - 128
  - 13
  - 224
  - 227
  - 33
  - 110
  - 211
  - 117
  - 229
  consensushash:
  - 4
  - 128
  - 145
  - 188
  - 125
  - 220
  - 40
  - 63
  - 119
  - 191
  - 191
  - 145
  - 215
  - 60
  - 68
  - 218
  - 88
  - 195
  - 223
  - 138
  - 156
  - 188
  - 134
  - 116
  - 5
  - 216
  - 183
  - 243
  - 218
  - 173
  - 162
  - 47
  apphash:
  - 46
  - 20
  - 193
  - 1
  - 170
  - 161
  - 0
  - 204
  - 249
  - 168
  - 178
  - 167
  - 87
  - 14
  - 107
  - 64
  - 155
  - 43
  - 194
  - 91
  - 34
  - 248
  - 227
  - 165
  - 102
  - 24
  - 122
  - 139
  - 225
  - 10
  - 33
  - 241
  lastresultshash: []
  evidencehash: []
  proposeraddress:
  - 56
  - 221
  - 57
  - 184
  - 224
  - 40
  - 193
  - 131
  - 153
  - 178
  - 27
  - 216
  - 206
  - 120
  - 180
  - 51
  - 211
  - 182
  - 28
  - 13
  xxx_nounkeyedliteral: {}
  xxx_unrecognized: []
  xxx_sizecache: 0
valset:
- |
  operatoraddress: stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p
  conspubkey: stvalconspub1zcjduepq2p4cvt0dgzsjlzjvnk8ux83a53wcqlmtnedrrl0q9nwxas5v6kes60nvlu
  jailed: false
  status: 2
  tokens: "500000010000"
  delegatorshares: "500000010000.000000000000000000"
  description:
    moniker: node
    identity: ""
    website: ""
    security_contact: ""
    details: ""
  unbondingheight: 0
  unbondingcompletiontime: 1970-01-01T00:00:00Z
  commission:
    commission_rates:
      rate: "0.100000000000000000"
      max_rate: "0.200000000000000000"
      max_change_rate: "0.010000000000000000"
    update_time: 2021-08-05T19:50:36.933902279Z
  minselfdelegation: "1"

pool

Query values for amounts stored in the staking pool.

Usage:
  stchaincli query staking pool [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for pool
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")

Query command:

stchaincli query staking pool --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking pool --chain-id=test-chain-localnet
    not_bonded_tokens: "181513332"
    bonded_tokens: "400001000"

staking-params

Query values set as staking parameters.

Usage:
  stchaincli query staking params [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for params
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking params --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking params --chain-id=test-chain-localnet
    unbonding_time: 504h0m0s
    max_validators: 100
    max_entries: 7
    historical_entries: 0
    bond_denom: ustos

validator

Query details about an individual validator

Usage:
  stchaincli query staking validator <validator-addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for validator
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")

Query command:

stchaincli query staking validator <validator-addr> --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking validator stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --chain-id=test-chain-localnet
- |
  operatoraddress: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
  conspubkey: stvalconspub1zcjduepqsnwlx7rv0ghyvh9tm99zle39df99jt8hccwt8jdrvjs26zqrzh9shdmgyc
  jailed: false
  status: 2
  tokens: "100000000"
  delegatorshares: "100000000.000000000000000000"
  description:
    moniker: node0
    identity: ""
    website: ""
    security_contact: ""
    details: ""
  unbondingheight: 0
  unbondingcompletiontime: 1970-01-01T00:00:00Z
  commission:
    commission_rates:
      rate: "0.100000000000000000"
      max_rate: "0.200000000000000000"
      max_change_rate: "0.010000000000000000"
    update_time: 2021-06-30T15:20:12.852765697Z
  minselfdelegation: "1"

validators

Query values for amounts stored in the staking pool.

Usage:
  stchaincli query staking validators [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for validators
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query staking validators --chain-id=<current chain-id>

Example:

$ ./stchaincli query staking validators --chain-id=test-chain-localnet
    - |
      operatoraddress: stvaloper1gtw399h9vfnekqsz3dg4n6mj0qgdpnh30x66xa
      conspubkey: stvalconspub1zcjduepqy4rzfu0jmefeh5cfmrjrfs57h2yleruhp3vkmsxa2qu4ux65xz4s3j6me8
      jailed: false
      status: 2
      tokens: "100000000"
      delegatorshares: "100000000.000000000000000000"
      description:
        moniker: node3
        identity: ""
        website: ""
        security_contact: ""
        details: ""
      unbondingheight: 0
      unbondingcompletiontime: 1970-01-01T00:00:00Z
      commission:
        commission_rates:
          rate: "0.100000000000000000"
          max_rate: "0.200000000000000000"
          max_change_rate: "0.010000000000000000"
        update_time: 2021-06-30T15:20:12.852765697Z
      minselfdelegation: "1"
    - |
      operatoraddress: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
      conspubkey: stvalconspub1zcjduepqsnwlx7rv0ghyvh9tm99zle39df99jt8hccwt8jdrvjs26zqrzh9shdmgyc
      jailed: false
      status: 2
      tokens: "100000000"
      delegatorshares: "100000000.000000000000000000"
      description:
        moniker: node0
        identity: ""
        website: ""
        security_contact: ""
        details: ""
      unbondingheight: 0
      unbondingcompletiontime: 1970-01-01T00:00:00Z
      commission:
        commission_rates:
          rate: "0.100000000000000000"
          max_rate: "0.200000000000000000"
          max_change_rate: "0.010000000000000000"
        update_time: 2021-06-30T15:20:12.852765697Z
      minselfdelegation: "1"
    - |
      operatoraddress: stvaloper1kuhyf59qvukk8r5manky062d6c66utvyuhha73
      conspubkey: stvalconspub1zcjduepq00dtcmtnxjmqugvlzmyc8ddrwu2mqskd077y5wkxqgfyk365xzlsm9vete
      jailed: false
      status: 2
      tokens: "100000000"
      delegatorshares: "100000000.000000000000000000"
      description:
        moniker: node2
        identity: ""
        website: ""
        security_contact: ""
        details: ""
      unbondingheight: 0
      unbondingcompletiontime: 1970-01-01T00:00:00Z
      commission:
        commission_rates:
          rate: "0.100000000000000000"
          max_rate: "0.200000000000000000"
          max_change_rate: "0.010000000000000000"
        update_time: 2021-06-30T15:20:12.852765697Z
      minselfdelegation: "1"
    - |
      operatoraddress: stvaloper1m4f4hnyfhpaeqlcgv7lfhgzjwmrvfeggelgy5f
      conspubkey: stvalconspub1zcjduepq7f8w4wt0vm7vr9xz6k8w5kraqqhrd3q9hp8vq8l0cgr5hw0tdnaqk4khxz
      jailed: false
      status: 2
      tokens: "100000000"
      delegatorshares: "100000000.000000000000000000"
      description:
        moniker: node1
        identity: ""
        website: ""
        security_contact: ""
        details: ""
      unbondingheight: 0
      unbondingcompletiontime: 1970-01-01T00:00:00Z
      commission:
        commission_rates:
          rate: "0.100000000000000000"
          max_rate: "0.200000000000000000"
          max_change_rate: "0.010000000000000000"
        update_time: 2021-06-30T15:20:12.852765697Z
      minselfdelegation: "1"


Others

Qconfig

Create or query an application CLI configuration file.

Usage:
  stchaincli config <key> <value> [flags]

Flags:
      --get    print configuration value or its default if unset
  -h, --help   help for config

Create config Example

Tx command:

stchaincli config keyring-backend test

Example:

$ ./stchaincli config keyring-backend local-test
  configuration saved to $HOME/.stchaincli/config/config.toml

Query config Example

Query command:

stchaincli config --get=keyring-backend

Example:

$ ./stchaincli config --get=keyring-backend
  local-test

keys

Keys allow user to manage your local keystore for tendermint.

Usage:
  stchaincli keys [command]

Available Commands:
  mnemonic    Compute the bip39 mnemonic for some input entropy
  add         Add an encrypted private key (either newly generated or recovered), encrypt it, and save to disk
  export      Export private keys
  import      Import private keys into the local keybase
  list        List all keys
  show        Show key info for the given name

  delete      Delete the given keys
  parse       Parse address from hex to bech32 and vice versa
  migrate     Migrate keys from the legacy (db-based) Keybase

Flags:
  -h, --help                     help for keys
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")

Queries

list

Query command:

stchaincli keys list --chain-id=<current chain-id> --keyring-backend=<keyring's backend'>

Example:

$ ./stchaincli keys list --chain-id=test-chain-localnet --keyring-backend=test
    - name: user0
      type: local
      address: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
      pubkey: stpub1addwnpepqtve9pagyps72e0j253cr64ca9edufa2qtg6qep38vhnhaz0z04kvmv3x60
      mnemonic: ""
      threshold: 0
      pubkeys: []

rest-server

Start LCD (light-client daemon), a local REST server.

Usage:
  stchaincli rest-server [flags]

Flags:
      --height int           Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help                 help for rest-server
      --indent               Add indent to JSON response
      --laddr string         The address for the server to listen on (default "tcp://localhost:1317")
      --ledger               Use a connected Ledger device
      --max-open uint        The number of maximum open connections (default 1000)
      --node string          <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --read-timeout uint    The RPC read timeout (in seconds) (default 10)
      --trust-node           Trust connected full node (don't verify proofs for responses)
      --unsafe-cors          Allows CORS requests from all domains. For development purposes only, use it at your own risk.
      --write-timeout uint   The RPC write timeout (in seconds) (default 10)

Query command:

stchaincli rest-server --unsafe-cors --laddr tcp://localhost:1317 --node=tcp://localhost:26657 --chain-id=<current chain-id>

Example:

$ ./stchaincli rest-server --unsafe-cors --laddr tcp://localhost:1317 --node=tcp://localhost:26657 --chain-id=test-chain-localnet
    I[2021-07-24|16:55:58.587] Starting application REST service (chain-id: "test-chain-localnet")... module=rest-server
    I[2021-07-24|16:55:58.587] Starting RPC HTTP server on 127.0.0.1:1317   module=rest-server

status

Query remote node for status.

Usage:
  stchaincli status [flags]

Flags:
  -h, --help          help for status
      --indent        Add indent to JSON response
  -n, --node string   Node to connect to (default "tcp://localhost:26657")

Query command:

stchaincli status --chain-id=<current chain-id>

Example:

$ ./stchaincli status --chain-id=test-chain-localnet
    {
      "node_info": {
        "protocol_version": {
          "p2p": "7",
          "block": "10",
          "app": "0"
        },
        "id": "e196bf5b3e3d583b48e214cf683b7763686187c8",
        "listen_addr": "tcp://0.0.0.0:26656",
        "network": "test-chain-localnet",
        "version": "0.33.9",
        "channels": "4020212223303800",
        "moniker": "node0",
        "other": {
          "tx_index": "on",
          "rpc_address": "tcp://127.0.0.1:26657"
        }
      },
      "sync_info": {
        "latest_block_hash": "8CA3467E3BF22E17A1649BBA30AC27BC133F7C4E5E085FDEEAAA06D91F2C8A64",
        "latest_app_hash": "7554B2BF2D51F090109EA1DAB447E44EB43984CC2AE1E7A949A00363BDF148C7",
        "latest_block_height": "3898",
        "latest_block_time": "2021-07-24T04:08:54.426398218Z",
        "earliest_block_hash": "8B0BB90BAFA8FC9478782C4CFB71E4A7064E1ACF0AA01D5454716BCC41774761",
        "earliest_app_hash": "",
        "earliest_block_height": "1",
        "earliest_block_time": "2021-06-30T15:20:12.852765697Z",
        "catching_up": false
      },
      "validator_info": {
        "address": "8768780A615692B07081314B502B3C18340244EB",
        "pub_key": {
          "type": "tendermint/PubKeyEd25519",
          "value": "hN3zeGx6LkZcq9lKL+YlakpZLPfGHLPJo2SgrQgDFcs="
        },
        "voting_power": "100"
      }
    }

version

Print the app version.

Usage:
  stchaincli status [flags]

Flags:
  -h, --help          help for status
      --indent        Add indent to JSON response
  -n, --node string   Node to connect to (default "tcp://localhost:26657")

uery command:

stchaincli version --chain-id=<current chain-id>

Example:

$ ./stchaincli version --chain-id=test-chain-localnet
  v0.3.0

account

Query account balance.

Usage:
  stchaincli query account <address> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for account
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

 ./stchaincli query account <address> --chain-id=<current chain-id>

Example:

$ ./stchaincli query account st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain-localnet
|
  address: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
  coins:
  - denom: ustos
    amount: "49999043185135473"
  public_key: stpub1addwnpepqtve9pagyps72e0j253cr64ca9edufa2qtg6qep38vhnhaz0z04kvmv3x60
  account_number: 0
  sequence: 52

tendermint-validator-set

Get the full tendermint validator set at given height

Usage:
  stchaincli query tendermint-validator-set <height> [flags]

Flags:
  -h, --help          help for tendermint-validator-set
      --indent        indent JSON response
      --limit int     Query number of results returned per page (default 100)
  -n, --node string   Node to connect to (default "tcp://localhost:26657")
      --page int      Query a specific page of paginated results
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

./stchaincli query tendermint-validator-set <height> --trust-node

Example:

$ ./stchaincli query tendermint-validator-set 1 --trust-node
    blockheight: 1
    validators:
    - address: stvalcons1yw0f3vwqh9mfrxzptcslujj5tgsxmgqfyj5crp
      pubkey: stvalconspub1zcjduepq00dtcmtnxjmqugvlzmyc8ddrwu2mqskd077y5wkxqgfyk365xzlsm9vete
      proposerpriority: -300
      votingpower: 100
    - address: stvalcons1s9lxr438tafq5a88jcwfrkj0nkh0w7hzl233qx
      pubkey: stvalconspub1zcjduepqy4rzfu0jmefeh5cfmrjrfs57h2yleruhp3vkmsxa2qu4ux65xz4s3j6me8
      proposerpriority: 100
      votingpower: 100
    - address: stvalcons1sa58sznp26ftquypx994q2eurq6qy38tfm3rn3
      pubkey: stvalconspub1zcjduepqsnwlx7rv0ghyvh9tm99zle39df99jt8hccwt8jdrvjs26zqrzh9shdmgyc
      proposerpriority: 100
      votingpower: 100
    - address: stvalcons1hqxc7552yvxxjcj2s57e8ytekjnk3mnlpy60na
      pubkey: stvalconspub1zcjduepq7f8w4wt0vm7vr9xz6k8w5kraqqhrd3q9hp8vq8l0cgr5hw0tdnaqk4khxz
      proposerpriority: 100
      votingpower: 100

block

Get verified data for a block at given height.

Usage:
  stchaincli query block <height> [flags]

Flags:
  -h, --help          help for block
  -n, --node string   Node to connect to (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query block <height> --chain-id=<current chain-id>

Example:

$ ./stchaincli query block  4560 --chain-id=test-chain-localnet
  {
    "block_id": {
        "hash": "39261B71FE0AB73FA55E47FD3272CF4915347BE150B9F144E657F26E178B9F0B",
        "parts": {
            "total": "1",
            "hash": "C8158F0485487CD36EA63FFA522222095A1DCBAA660A882550519576A4B6AA72"
        }
    },
    "block": {
        "header": {
            "version": {
                "block": "10",
                "app": "0"
            },
            "chain_id": "test-chain-localnet",
            "height": "4560",
            "time": "2021-07-25T17:58:08.769071908Z",
            "last_block_id": {
                "hash": "44B6E8AB1F94D3FAFF5AA9C26187E0323119ECC38173F98CDEA92477CAA91E46",
                "parts": {
                    "total": "1",
                    "hash": "6431AF94E384CE5800F5653436F3C3B73F70BFC8CC0FFCFF9E5AE03EA0258E09"
                }
            },
            "last_commit_hash": "3AE7BBD8E2856B2AE8B26EF089B66BF4A877EE5C68238278F433C1FB6018F570",
            "data_hash": "",
            "validators_hash": "49E7F0C8F257AFB75071CD3D9167A5B4536388A385EE9A5F5C437493B1378742",
            "next_validators_hash": "49E7F0C8F257AFB75071CD3D9167A5B4536388A385EE9A5F5C437493B1378742",
            "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F",
            "app_hash": "6570781E66062F1FC021059E0EDF258F14096F7B090A7E2B0882E218024DAC41",
            "last_results_hash": "",
            "evidence_hash": "",
            "proposer_address": "8768780A615692B07081314B502B3C18340244EB"
        },
        "data": {
            "txs": null
        },
        "evidence": {
            "evidence": null
        },
        "last_commit": {
            "height": "4559",
            "round": "0",
            "block_id": {
                "hash": "44B6E8AB1F94D3FAFF5AA9C26187E0323119ECC38173F98CDEA92477CAA91E46",
                "parts": {
                    "total": "1",
                    "hash": "6431AF94E384CE5800F5653436F3C3B73F70BFC8CC0FFCFF9E5AE03EA0258E09"
                }
            },
            "signatures": [
                {
                    "block_id_flag": 2,
                    "validator_address": "239E98B1C0B9769198415E21FE4A545A206DA009",
                    "timestamp": "2021-07-25T17:58:08.783458494Z",
                    "signature": "wAsxcMdzLk/iehYdk3DTT4f2zWO1BNfslgDLbxnRf2haUcdPTflJlUrN99xjRRQDuTy7rcUPy/lf9FfcEpAhAg=="
                },
                {
                    "block_id_flag": 2,
                    "validator_address": "817E61D6275F520A74E7961C91DA4F9DAEF77AE2",
                    "timestamp": "2021-07-25T17:58:08.780207236Z",
                    "signature": "USakFV2Zjzvz21JnxkEYMa+04qB5zvt344x9Zv4Fv9IJ7uAHAIK2vcq5ZYKEdXw26EC9Wa6jHmG4SpVQAIrnDQ=="
                },
                {
                    "block_id_flag": 2,
                    "validator_address": "8768780A615692B07081314B502B3C18340244EB",
                    "timestamp": "2021-07-25T17:58:08.769071908Z",
                    "signature": "RXMxe7/B+1bqEymo9xlie1KJ5/H4oWVeoEjg0DG7i57x6kVR7sdkkdLlDPpGqyeZRQ6wyyYNxb9PdrCmWsfpCQ=="
                },
                {
                    "block_id_flag": 2,
                    "validator_address": "B80D8F528A230C69624A853D939179B4A768EE7F",
                    "timestamp": "2021-07-25T17:58:08.75173712Z",
                    "signature": "YE6chplIrNrhcxgIWeoB4ho2dYxZkmmxOLxnjntzP/fhGQZpRZ2TIs0QQ8nK882f6607YnPl3s2HK5QvDcRkBw=="
                }
            ]
        }
    }
}

txs

Search for transactions that match the exact given events where results are paginated. Each event takes the form of '{eventType}.{eventAttribute}={value}'. Please refer to each module's documentation for the full set of events to query for.

Usage:
  stchaincli query txs [flags]

Flags:
      --events string   list of transaction events in the form of {eventType}.{eventAttribute}={value}
  -h, --help            help for txs
      --limit uint32    Query number of transactions results per page returned (default 30)
  -n, --node string     Node to connect to (default "tcp://localhost:26657")
      --page uint32     Query a specific page of paginated results (default 1)
      --trust-node      Trust connected full node (don't verify proofs for responses)

Query command:

./stchaincli query txs --events <'list of transaction events'> --chain-id=<current chain-id> --limit=<number of transactions results per page>

Example:

$ ./stchaincli query txs --events 'message.sender=st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k' --chain-id=test-chain-localnet --limit=20
  {
    "total_count": "2",
    "count": "2",
    "page_number": "1",
    "page_total": "1",
    "limit": "20",
    "txs": [
        {
            "height": "3681",
            "txhash": "EA0AB730219917533E73B1509EC38AE26614B2A8C4C4EA4E90026262127E8672",
            "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"vote\"},{\"key\":\"module\",\"value\":\"governance\"},{\"key\":\"sender\",\"value\":\"st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k\"}]},{\"type\":\"proposal_vote\",\"attributes\":[{\"key\":\"option\",\"value\":\"Yes\"},{\"key\":\"proposal_id\",\"value\":\"7\"}]}]}]",
            "logs": [
                {
                    "msg_index": 0,
                    "log": "",
                    "events": [
                        {
                            "type": "message",
                            "attributes": [
                                {
                                    "key": "action",
                                    "value": "vote"
                                },
                                {
                                    "key": "module",
                                    "value": "governance"
                                },
                                {
                                    "key": "sender",
                                    "value": "st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k"
                                }
                            ]
                        },
                        {
                            "type": "proposal_vote",
                            "attributes": [
                                {
                                    "key": "option",
                                    "value": "Yes"
                                },
                                {
                                    "key": "proposal_id",
                                    "value": "7"
                                }
                            ]
                        }
                    ]
                }
            ],
            "gas_wanted": "200000",
            "gas_used": "38472",
            "tx": {
                "type": "cosmos-sdk/StdTx",
                "value": {
                    "msg": [
                        {
                            "type": "cosmos-sdk/MsgVote",
                            "value": {
                                "proposal_id": "7",
                                "voter": "st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k",
                                "option": "Yes"
                            }
                        }
                    ],
                    "fee": {
                        "amount": [],
                        "gas": "200000"
                    },
                    "signatures": [
                        {
                            "pub_key": {
                                "type": "tendermint/PubKeySecp256k1",
                                "value": "A8h5ZfH926q3EMdHeOdT2Z5W1KDjOc3LT33quKK8uCdZ"
                            },
                            "signature": "yE56xpZ4OI3+HxQr5bklYHuAOspKlwVC7hiSKnja63khIlU+TTnEhgoRvNgYub58HVbOBtslHU7QncNKSWEEbg=="
                        }
                    ],
                    "memo": ""
                }
            },
            "timestamp": "2021-07-23T14:41:18Z"
        },
        {
            "height": "4400",
            "txhash": "D21722FE6C3DE53268EEAF1A9C433DACF635B2715F6B5DCFBD5EED7B28705BE8",
            "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"vote\"},{\"key\":\"module\",\"value\":\"governance\"},{\"key\":\"sender\",\"value\":\"st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k\"}]},{\"type\":\"proposal_vote\",\"attributes\":[{\"key\":\"option\",\"value\":\"Yes\"},{\"key\":\"proposal_id\",\"value\":\"9\"}]}]}]",
            "logs": [
                {
                    "msg_index": 0,
                    "log": "",
                    "events": [
                        {
                            "type": "message",
                            "attributes": [
                                {
                                    "key": "action",
                                    "value": "vote"
                                },
                                {
                                    "key": "module",
                                    "value": "governance"
                                },
                                {
                                    "key": "sender",
                                    "value": "st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k"
                                }
                            ]
                        },
                        {
                            "type": "proposal_vote",
                            "attributes": [
                                {
                                    "key": "option",
                                    "value": "Yes"
                                },
                                {
                                    "key": "proposal_id",
                                    "value": "9"
                                }
                            ]
                        }
                    ]
                }
            ],
            "gas_wanted": "200000",
            "gas_used": "38508",
            "tx": {
                "type": "cosmos-sdk/StdTx",
                "value": {
                    "msg": [
                        {
                            "type": "cosmos-sdk/MsgVote",
                            "value": {
                                "proposal_id": "9",
                                "voter": "st1gtw399h9vfnekqsz3dg4n6mj0qgdpnh3c2n66k",
                                "option": "Yes"
                            }
                        }
                    ],
                    "fee": {
                        "amount": [],
                        "gas": "200000"
                    },
                    "signatures": [
                        {
                            "pub_key": {
                                "type": "tendermint/PubKeySecp256k1",
                                "value": "A8h5ZfH926q3EMdHeOdT2Z5W1KDjOc3LT33quKK8uCdZ"
                            },
                            "signature": "+w/Qhm6JdyQLXsquiKe0WCqCNjqois2Zhc76h0AphDhQZTKlpD9qlVuA/BX7gmVrmiUdqG/G4YExu8XkQSvnSg=="
                        }
                    ],
                    "memo": ""
                }
            },
            "timestamp": "2021-07-25T00:36:47Z"
        }
    ]
}

tx

Query for a transaction by hash in a committed block.

Usage:
  stchaincli query tx <hash> [flags]

Flags:
  -h, --help          help for tx
  -n, --node string   Node to connect to (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

./stchaincli query tx <tx hash> --trust-node

Example:

$ ./stchaincli query tx 294F64594EA4B6D608AE3E1C080E3C5363C1A2CA2FB0AD171517E8A0F0D7CD08 --trust-node
    height: 657
    txhash: 294F64594EA4B6D608AE3E1C080E3C5363C1A2CA2FB0AD171517E8A0F0D7CD08
    codespace: ""
    code: 0
    data: ""
    rawlog: '[{"msg_index":0,"log":"","events":[{"type":"message","attributes":[{"key":"action","value":"withdraw_delegator_reward"},{"key":"module","value":"distribution"},{"key":"sender","value":"st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda"}]},{"type":"withdraw_rewards","attributes":[{"key":"amount"},{"key":"validator","value":"stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k"}]}]}]'
    logs:
    - msgindex: 0
      log: ""
      events:
      - type: message
        attributes:
        - key: action
          value: withdraw_delegator_reward
        - key: module
          value: distribution
        - key: sender
          value: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
      - type: withdraw_rewards
        attributes:
        - key: amount
          value: ""
        - key: validator
          value: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
    info: ""
    gaswanted: 200000
    gasused: 76692
    tx:
      msg:
      - delegator_address: st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda
        validator_address: stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k
      fee:
        amount: []
        gas: 200000
      signatures:
      - |
        pubkey: stpub1addwnpepqtve9pagyps72e0j253cr64ca9edufa2qtg6qep38vhnhaz0z04kvmv3x60
        signature: !!binary |
          G3TKyP6/AUgIrmdqWCcBFFB9KK/+5bFwZ/VoLVMUGrMnamLFEOFIEoRhwsRSja3Wr4NgvS
          bX1y72qWdgDGraAQ==
      memo: ""
    timestamp: "2021-07-22T19:56:53Z"


Last updated