Cosmos SDK build node + recover account, create, Delegate Stake

melea crypto
Jun 16 · 6 min read

# Hello,

Cosmoshub the Blockchain for IBC is here producing blocks now. This is about

a) Build and run a node.

b) Create an account or recover one.

c) Delegate $ATOMS to Validators.

e) Be Happy.

All are tested in one VPS with 2 Cores, 8 Ram, Ubuntu 16.04

Learn more about Cosmos Network


A) Build from source (install Goland + Cosmos + tools)

B) Run Docker container (Install Docker)

Run Docker container (Install Docker) =

Let’s go

A) Build from source

#Update setup local time and install tools

sudo apt update && apt upgrade -ysudo apt-get install build-essentialdpkg-reconfigure locales

Update open files Ubuntu

#check your user's per-process open file limit
ulimit -Sn

​#increase username's per process limit
sudo vi /etc/security/limits.conf#Add this for updateusername soft nofile 2048

sudo reboot now

#Install go

wget -c '' -O go1.12.4.linux-amd64.tar.gzsudo tar -C /usr/local -xzf go1.12.4.linux-amd64.tar.gzrm -rf go1.12.4.linux-amd64.tar.gzvi $HOME/.profile#Add this to your path#GOPATH="$HOME/go"
#Safe the file and reload the profile
source $HOME/.profile
go version
#go version go1.12.4.linux-amd64

Update GO to go1.12.4.linux-amd64 if need

#Remove old go 
sudo rm -rf /usr/local/go
#Download last go
wget -c '[']( -O go1.12.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.12.4.linux-amd64.tar.gz
#Remove useless files
rm -rf go1.12.4.linux-amd64.tar.gz
go version
#go version go1.12.4 linux/amd64

Update gaiad if already is installed

cd $GOPATH/src/ fetch --allgit checkout v0.34.7; GO111MODULE=on; make installgaiad version

Install Cosmos gaiad

mkdir -p $GOPATH/src/ $GOPATH/src/ clone cosmos-sdk && git checkout mastergit checkout v0.34.7; GO111MODULE=on; make installgaiad version
gaiacli version

Cosmos Gaiad has installed successfully, now setup

#Create folders and add mane at the nodegaiad init Node-Name-here --chain-id cosmoshub-2#Remove the test genesis.json file
cd .cosmos/config
rm genesis.json
#Copy some importants file
cp priv_validator_key.json $HOME
cp node_key.json $HOME#Get the genesis.json for Cosmos-hub2wget peers or seeds you know that can trust then.
vi .cosmos/config/config.toml
# Comma separated list of nodes to keep persistent connections to
persistent_peers = "64da6049644cc21736544056fba402310ad8a7fe@"
#safe the file and start Cosmosgaiad start

Looks like this meanwhile is downloading the existing Blocks and sync the last.

Downloading the Cosmos Blockchain

For see the last block sync and the status and info in this node

gaiacli status
gaiacli status

AkA when “catching_up”: false

the node is sync the last block.

Create one account for received $ATOM $uATOM Tokens and delegate or just hold.

gaiacli keys add WRITE-ONE-NAME-HERE
IMPORTANT NOTE: safe the mnemonic pharse in a safe place!
  • *Important** write this seed phrase in a safe place. works to recover the account.

For recover one account unless creating a new one

gaiacli keys add --recover (this-is=KEY-NAME=WRITE-ONE-NAME-HERE)

Keep safe the words for recovery the account whenever necessary. AKA (Seed phrase)

For recover your account from the Cosmos fundraiser or so with the Seed phrase just

docker run -it -v $HOME/.gaiacli:/root/.gaiacli meleatrust/cosmos-sdk:v0.34.6 gaiacli keys add imvalidator --recover

Note the account from the fundraiser is different than the actual Cosmos address, not worry, after dump your safe words obtain a new account new format with the balanced from the fundraiser.

For see the new accounts in the localhost.

gaiacli keys list

List of commands for play and learn.

gaia -hgaiacli -hgaia versiongaiacli version

Check the Balanced in the account

The balanced is true when the node is totally synced the last block.

gaiacli query account cosmos1zqght.......t --trust-node

How to delegate stake?

Where can see the Validator list:

Cosmos Explorers

List of actives Validators via command line

gaiacli query staking validators --chain-id cosmoshub-2

This is one validator and other different is bellow

In the explorer can see the same details but more web site style.

This is my Validator = meleaTrust

Now in the process for down the commission every day 1% less until going to 0% for some time.

Consider delegate some $Atoms to my node if you wish more work like this.

Every day we try to do the best job in validation possible. And be near to the community.

Need assistance or any help feel free to DM Telegram user @melea_trader @meleatrust or sent email

Talking about ATOMS and UATOMS

1 Atom = 1,000,000.00 UATOMS

Example for delegate 1000 atoms

for Delegate 1000 ATOMS = 1000000000 UATOMS

For delegate to one validator have to check the operator address in the description for each validator.

Operator Address :cosmosvaloper1zqgheeawp7cmqk27dgyctd80rd8ryhqs6la9wc

After copy, the address for delegate cosmosvaloper….. paste in the cmd like in the next example.

You can delegate to as many Validators as you want

staking delegate cosmosvaloper1zqgheeawp7cmqk27dgyctd80rd8ryhqs6la9wc 1000000000uatom --gas auto --gas-prices 0.025uatom --from keyname --chain-id cosmoshub-2 --node

If after sending one TX the output is

ERROR: broadcast_tx_commit: Response error: RPC error -32603 — Internal error: Timed out waiting for tx to be included in a block

This means your transaction is in the pool for becoming true. just have to wait, but if have some bad parameter like less gass, then fail, have to check later in the explorers if come true after a while. If not sent again.

For Undelegate or Unbond and get Atoms Out the validator service

Example for Unbond 1000 atoms from Validator

gaiacli tx staking unbond cosmosvaloper1zqgheeawp7cmqk27dgyctd80rd8ryhqs6la9wc 1000000000 --gas auto --gas-prices 0.025uatom --from keyname --chain-id cosmoshub-2 --node

For a list of staking commands

gaiacli tx staking -h

Then if want to redelegate from one validator to others can ask for help like

gaiacli tx staking redelegate -h

then can see the command example and add to the docker command line.

Note: what is keyname?

keyname is the account name.


keys list

Here NAME: melea is keyname so in the command line example

gaiacli tx staking unbond cosmosvaloper1zqgheeawp7cmqk27dgyctd80rd8ryhqs6la9wc 1000000000 --gas auto --gas-prices 0.025uatom --from melea --chain-id cosmoshub-2 --node
we are validating thanks to your support

Consider delegate or support my node in any way if you liked my job for CosmosHub in Validation service.

Thanks in advanced.

meleatrust Validator

gaiacli tx staking delegate cosmosvaloper1zqgheeawp7cmqk27dgyctd80rd8ryhqs6la9wc 100000000uatom --gas auto --gas-prices 0.025uatom --from Key-name --chain-id cosmoshub-2 --node

Happy validating

Looking for learning how to make one backup file for Cosmos Blockchain: