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.

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

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

.stchaind contains config and data folders.

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.

--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.

Tx command:

Example:


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.

Tx command:

Example:

-withdraw-all-rewards

Withdraw all delegation rewards for a delegator.

Tx command:

Example:

Queries

commission

Query validator commission rewards from delegators to that validator.

commission Example

Query command:

Example:

rewards

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

rewards Example

Query command:

Example:

validator-outstanding-rewards

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

validator-outstanding-rewards Example

Query command:

Example:

community-pool

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

community-pool Example

Query command:

Example:

slashes

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

slashes Example

Query command:

Example:

distribution-params

Query distribution params.

params Example

Query command:

Example:


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.

submit-proposal Example

Where proposal.json contains:

equivalent to:

submit-proposal Tx command:

Example:

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.

param-change tx command:

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

Example:

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.

community-pool-spend tx command:

The proposal.json could be:

Example:

software-upgrade Example

Submit a software upgrade along with an initial deposit.

software-upgrade tx command:

-deposit

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

Tx command:

Example:

-vote

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

Tx command:

Example:

Queries

proposal

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

Query command:

Example:

proposals

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

Query command:

Example:

vote

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

Query command:

Example:

votes

Query vote details for a single proposal by its identifier.

Query command:

Example:

deposit

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

Query command:

Example:

deposits

Query details for all deposits on a proposal.

Query command:

Example:

Slashing Module

Transaction

-unjail

Unjail a jailed validator.

Tx command:

Example:

Queries

signing-info

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

Query command:

Example:

slashing-params

Query genesis parameters for the slashing module.

Query command:

Example:

Staking Module

Transactions

-delegate

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

Tx command:

Example:

-redelegate

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

Tx command:

Example:

-unbond

Unbond an amount of bonded shares from a validator.

Tx command:

Example:

-create-validator

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

  • 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:

Example:

-edit-validator

Edit an existing validator account.

Tx command:

Example:

Queries

delegation

Query a delegation based on delegator address and validator address.

Query command:

Example:

delegations

Query delegations for an individual delegator on all validators.

Query command:

Example:

delegations-to

Query all delegations made to one validator.

Query command:

Example:

unbonding-delegations

Query unbonding delegations for an individual delegator.

Query command:

Example:

unbonding-delegation

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

Please refer to here and here for more details.

Query command:

Example:

unbonding-delegations-from

Query all unbonding delegatations from a validator.

Query command:

Example:

redelegation

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

Query command:

Example:

redelegations

Query all redelegations records for one delegator.

Query command:

Example:

redelegations-from

Query all unbonding delegations from a validator.

Query command:

Example:

historical-info

Query historical info at given height.

Example

When the skating parameters are the following, for example

Query command:

Example:

pool

Query values for amounts stored in the staking pool.

Query command:

Example:

staking-params

Query values set as staking parameters.

Query command:

Example:

validator

Query details about an individual validator

Query command:

Example:

validators

Query values for amounts stored in the staking pool.

Query command:

Example:



Others

Qconfig

Create or query an application CLI configuration file.

Create config Example

Tx command:

Example:

Query config Example

Query command:

Example:

keys

Keys allow user to manage your local keystore for tendermint.

Queries

list

Query command:

Example:

rest-server

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

Query command:

Example:

status

Query remote node for status.

Query command:

Example:

version

Print the app version.

uery command:

Example:

account

Query account balance.

Query command:

Example:

tendermint-validator-set

Get the full tendermint validator set at given height

Query command:

Example:

block

Get verified data for a block at given height.

Query command:

Example:

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.

Query command:

Example:

tx

Query for a transaction by hash in a committed block.

Query command:

Example:


Last updated