Ultimate cyber CLI guide. Chain: bostrom
Install cyber client
It is possible to interact with cyber even if you don't have your own node. All you need to do is install cyber client on your machine using the script below, paste it in the console (currently Linux supported):
After installation, you will be able to use cyber to import accounts, create links or swap tokens.
In case you have your own node, which is already running inside Docker container, please add docker exec -ti container-name before every cyber command:
First of all, I would like to encourage you to use the --help feature if you want to have a better experience using cyber. This is a really easy way to find all the necessary commands with the appropriate options and flags.
For example, you can enter:
You should see this message:
The help feature works like a pyramid, you can use it with any command to find available options, subcommands and flags. For example, lets explore the query subcommands:
You can see the structure of the subcommand:
And the available subcommands and flags:
| ()
|||||| ()
Let's explore the bank subcommand:
We can see all of the options available for these subcommands, names and account address:
In most cases you will need just two extra flags:
--from=<your_key_name> \
That's it. This is a very useful tool for using cyber and troubleshooting.
Glossary
Bonded tokens - Tokens that are nominated to a validator, non transferable.
Commission - The tokens that you've earned via validating from delegators.
Dyson Sphere - Construct in cyber responsible for energy transformation and routing.
Investminting - Process of convertation Hydrogen to Volts or Amperes, locking a certain amount of H for a certain amount of time produces some V or A.
Hero - A validator.
Hydrogen - Token issued after boot delegation, 1:1 H to boot. Used to generate enery through the Dyson sphere (investminting process).
Unbonding - The process of taking back your share (delegated tokens + any rewards). 4 days for bostrom chain.
link - A reference between a CID key and a CID value. Link message cost is 100*n, where n is the number of links in a message. Link finalization time is 1 block. New rank for CIDs of links will be recalculated at a period of 5 blocks.
liquid tokens - Transferable tokens within the cyber.
local keystore - A store with keys on your local machine.
rewards - Tokens that a hero earned via delegation. To reduce network load all the rewards are stored in a pool. You can take your part of the bounty at any time with commands from the delegator section.
<comission_rate_percentage> - The commission that a validator gets for their work. Must be a fraction >0 and <=1
<delegator_address> - Delegator address. Starts with bostrom most often coinciding with <key_address>
<key_address> - An account address. Starts with bostrom
<key_name> - The name of the account in cyber
<operator_address> - Validator address. Starts with cybervaloper
<shares_percentage> - The part of illiquid tokens that you want to unbond or redelegate. Must be a fraction >0 and <=1
<chain_id> - The current version of the chain (bostrom).
General commands
Show all validators
Return the set of all active and jailed validators:
Show chain status
Return general chain information:
Distribution params
Staking params
Chain staking info:
Staking pool
Account management
Import an account with a seed phrase and store it in the local keystore
Create a new account
Show account information
Name, address and the public key of the current account
Show account balance
Return account number and amount of tokens.
List existing keys
Return all the existing keys in cyber:
Delete account from cyber
Keyring manipulation settings
Important note: Starting with v.38, Cosmos-SDK uses os-native keyring to store all of your keys. We've noticed that in certain cases it does not work well by default (for example if you don't have any GUI installed on your machine). If during the execution cyber keys add command, you are getting this type of error:
You will have to use another keyring backend to keep your keys.
In that case you'll have to use file based keyring by adding the --keyring-backend file option to every key manipulation command:
That means that you've set your keyring-backend to a local file. Note, in this case, all the keys in your keyring will be encrypted using the same password. If you would like to set up a unique password for each key, you should set a unique --home folder for each key. To do that, just use --home=/<unique_path_to_key_folder>/ with setup keyring backend and at all interactions with keys when using cyber:
Send tokens
Linking content
Only IPFS hashes are available to use as CIDs
Real command example:
Validator commands
Get all validators
State of a current validator
Return all delegations to a validator
Edit the commission in an existing validator account
Withdraw the commission for any delegation
Edit the site and description for an existing validator account
Unjail a validator previously jailed for downtime
Get info about a redelegation process from a validator
Delegator commands
Return distribution delegator rewards for a specified validator
Return delegator shares for the specified validator
Return all delegations made from a delegator
Return all unbonding delegations from a validator
Withdraw rewards for any delegation
Withdraw all delegation rewards
Change the default withdrawal address for rewards associated with an address
Delegate liquid tokens to a validator
Redelegate illiquid tokens from one validator to another in absolute BOOT value
There is a 4-day unbonding period
Redelegate illiquid tokens from one validator to another in percentages
--from=<your_key_name> \
Unbond shares from a validator in absolute BOOT value
8 days for unbonding
--from=<your_key_name> \
Unbond shares from a validator in percentages
8 days for unbonding
--from=<your_key_name> \
Get info about the unbonding delegation process to any validator
Get info about the unbonding delegation process to all unbonded validators
Get info about redelegation process from to current validator
Get the info about all the redelegation processes by a delegator
Governance and voting
Query specific proposal
Query all proposals
Query votes on proposal
Query parameters from governance module
Vote for specific proposal
Submit text proposal
Submit community spend proposal
Where proposal.json is a file, structured in following way:
Submit chain parameters change proposal
Where proposal.json is a file, structured in following way:
Few examples of real param-change proposals:
-
Change max block bandwidth:
-
Increase max block gas:
-
Change rank calculation window:
Liquidity and pools
Cyber has Gravity-DEX module implemented, so it is possible to create pools, swap tokens and add\remove liquidity to exisitng pools:
Create liquidity pool
This example creates a liquidity pool of pool-type 1 (two coins) and deposits 2000000milliampere and 200000000000boot. New liquidity pools can be created only for coin combinations that do not already exist in the network.
[pool-type]: The id of the liquidity pool-type. The only supported pool type is 1 [deposit-coins]: The amount of coins to deposit to the liquidity pool. The number of deposit coins must be 2 in pool type 1.
Example:
Deposit tokens to liquidity pool
Deposit coins a liquidity pool.
This deposit request is not processed immediately since it is accumulated in the liquidity pool batch. All requests in a batch are treated equally and executed at the same swap price.
Example:
This example request deposits 100000000milliampere and 50000000000boot to pool-id 1. Deposits must be the same coin denoms as the reserve coins.
[pool-id]: The pool id of the liquidity pool [deposit-coins]: The amount of coins to deposit to the liquidity pool
Swap coins
Swap offer coin with demand coin from the liquidity pool with the given order price.
This swap request is not processed immediately since it is accumulated in the liquidity pool batch. All requests in a batch are treated equally and executed at the same swap price. The order of swap requests is ignored since the universal swap price is calculated in every batch to prevent front running.
The requested swap is executed with a swap price that is calculated from the given swap price function of the pool, the other swap requests, and the liquidity pool coin reserve status. Swap orders are executed only when the execution swap price is equal to or greater than the submitted order price of the swap order.
Example:
For this example, imagine that an existing liquidity pool has with 1000000000hydrogen and 50000000000boot. This example request swaps 50000000boot for at least 950000hydrogen with the order price of 0.019 and swap fee rate of 0.003. A sufficient balance of half of the swap-fee-rate of the offer coin is required to reserve the offer coin fee.
The order price is the exchange ratio of X/Y, where X is the amount of the first coin and Y is the amount of the second coin when their denoms are sorted alphabetically. Increasing order price reduces the possibility for your request to be processed and results in buying hydrogen at a lower price than the pool price.
For explicit calculations, The swap fee rate must be the value that is set as liquidity parameter in the current network. The only supported swap-type is 1. For the detailed swap algorithm, see https://github.com/gravity-devs/liquidity
[pool-id]: The pool id of the liquidity pool [swap-type]: The swap type of the swap message. The only supported swap type is 1 (instant swap). [offer-coin]: The amount of offer coin to swap [demand-coin-denom]: The denomination of the coin to exchange with offer coin [order-price]: The limit order price for the swap order. The price is the exchange ratio of X/Y where X is the amount of the first coin and Y is the amount of the second coin when their denoms are sorted alphabetically [swap-fee-rate]: The swap fee rate to pay for swap that is proportional to swap amount. The swap fee rate must be the value that is set as liquidity parameter in the current network.
Usage:
Withdraw tokens from liquidity pool
Withdraw pool coin from the specified liquidity pool.
This swap request is not processed immediately since it is accumulated in the liquidity pool batch. All requests in a batch are treated equally and executed at the same swap price.
Example:
This example request withdraws 10000 pool coin from the specified liquidity pool. The appropriate pool coin must be requested from the specified pool.
[pool-id]: The pool id of the liquidity pool [pool-coin]: The amount of pool coin to withdraw from the liquidity pool
Usage:
Query existing pools
Query details of a liquidity pool
Example (with pool coin denom):
Query details about all liquidity pools on a network. Example: