Skip to content
Permalink
mateusz@bity.com Asmodat Push 23/04/2019 14:23:55 96ee14a Apr 23, 2019
1 contributor

Users who have contributed to this file

executable file 143 lines (69 sloc) 6.7 KB

Account Recovery & Delegators Guide

Command Line Only

Introduction

This tutorial showcases secure key extraction from the Cosmos Network fundraiser seed and delegation using basic tools and secure, open source software. It's however advised to use Ledger Wallet and follow our tutorial on how to delegate using a Hardware Wallet. If you choose to follow this tutorial make sure you run a clean machine with freshly installed Ubuntu 18.04 LTS operating system or follow our Create Secure Environment Guide. Another (but NOT recommended) option is to run a virtual machine using virtualization software such free VirtualBox and installing Ubuntu as VM to add another security layer. Note that VM method will not protect you against malware that is potentially already hosted on machine such as keyloggers when you will be retyping your fundraiser seed.

NOTE: If you choose to not follow Creating Secure Environment Guide and continue with your everyday "use" operating system we can't guarantee safety of your coins and some of the commands might cause breaking changes to your operating system. Remember that Antivirus / Antimalware software will never protect you against all threats and exploits that can reside on your everyday use Laptop or Personal Computer.

Prerequisites

Steps To Complete

  • Delegating your coins to validator of choice and querying account balance
  • Withdrawing your staking rewards & redelegation

Account Recovery From Fundraiser Seed

Once installation of essential tools is completed you can proceed to restore your account using fundraiser seed words by adding/creating new encrypted key used to sign transactions. For the tutorial purposes we will call it FundraiserSecret but it can be any word that will help you to recognize your key name.

gaiacli keys add FundraiserSecret --recover

You will be prompted to enter the password that will be used to encrypt your seed words. Once you confirm it by retyping you will be prompted to enter your 12 or 24 Cosmos Network fundraiser seed words. Final result should resemble following screenshot:

NOTE: Do NOT lose password you enter before you enter your seed words, it will be required later to send your transaction and unencrypt your FundraiserSecret by gaiacli, if you forget or lose it you will have to recover your account again by using gaiacli keys add command.

alt_text

The ADDRESS aka Cosmos Account Number is a public key - string with a human-readable prefix (e.g. cosmos1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) that identifies your account. When someone wants to send you funds you can provide them with that address.

Connecting to Cosmos Seed Node

gaiacli config trust-node false

gaiacli config chain-id cosmoshub-2

gaiacli config node https://nodes.cosmos-validators.com:443

To check current block height run:

gaiacli status | jq -r '.sync_info.latest_block_height'

To query your account balance execute:

gaiacli query account cosmos1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

NOTE: Your balance is displayed in uatom "Mico Atoms" NOT ATOMs so be careful. Delegation process will also require to define ATOM amounts in uatoms. 1 ATOM == 1'000'000 uatom's (so you have to remember to add 6 more zeroes to the value you want to delegate).

If you typed something wrong and you see error saying configuration is invalid or that there are issues with "toml" file, you can edit it by typing:

nano $HOME/.gaiacli/config/config.toml

Content should resemble following screenshot

alt_text

NOTE: When using nano editor in order to save changes press combination of keys: CTRL+O, [ENTER], CTRL+X

Delegating ATOMs to Your Validator of choice

For the purpose of this tutorial we will use Bity.com Cosmos Validator public address that is

cosmosvaloper1uv26ytrnmydyctq0s58ve2k6wn2p653mqs80fm

NOTE: This tutorial will work regardless of the validator public address you choose, please ensure good practices and due diligence when selecting validators to delegate your coins.

Before you can delegate you have to specify . this amount is "the amount you want to delegate" defined in micro atoms (10^-6 atoms or 1000000 uatoms per 1 ATOM).

If you wish to for example delegate 123 ATOMS you have to set this amount to 123000000uatom (suffix with 6 zeros and 'uatom' sting without white spaces)

gaiacli tx staking delegate cosmosvaloper1uv26ytrnmydyctq0s58ve2k6wn2p653mqs80fm <amountToBond>uatom --from FundraiserSecret --fees=50000uatom

Once you enter this command you will be prompted to type Y to confirm it's correctness and then type the password you used while recovering your key with 'gaiacli keys add' command to encrypt your FundraiserSecret.

From time to time you might experience Response: ERROR: broadcast_tx_commit: Response error: RPC error -32603 - Internal error: Timed out waiting for tx to be included in a block in such case you can just repeat the command until it succeeds.

Collecting Delegation Rewards

After certain period of time your account will accumulate rewards proportional to your stake and inflation of ATOM coins, in order to have your coins credited to your account you will have to send a "withdraw" transaction.

NOTE: If coins you earn are not withdrawn and then re-delegated they will not be earning you rewards so it's a good practice to once every while withdraw the rewards and redelegate for them to earn you more interest.

gaiacli tx distr withdraw-all-rewards --from FundraiserSecret --fees=50000uatom

Wait few seconds after confirming your transaction and retyping account password, then you can use following command to verify change on your account balance:

gaiacli query account  cosmos1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

See Also

You can’t perform that action at this time.