How to become a Validator Node In the Cosmos Blockchain. (Install Golang + Cosmos SDK)
Cosmos Testnest Gaia-6002 its alive,
Come to enjoy the testnet and run your own Node in the Cosmos Blockchain and build one Validator Node.
Official info about, Cosmos
https://twitter.com/cosmosvalidator
Later i cant edit this post, for that remember for update go to official Cosmos Repo or my web if was deprecated.
http://melea.es/cosmos-tuto/
https://github.com/cosmos/cosmos-sdk/tree/master/cmd/gaia/testnets
Ok, now you have clear what is Cosmos, and you know is going to be huge, maybe you want to run your node and if you have the skills and the time for be a Validator, try to be one of the list. I am in the list.
If you only want explore your skills you can run your node in home.
If your intentions is going to be one day one Validator, rent a server in one data center.
The node need high security and 24x7x365 days support.
Is not a game, is a serious job. Become a Validator. Have a lot responsabilitis, please red the Fac.
https://cosmos.network/validators/faq
Are you ready?
lest do it.
Talking in what you need for build your Own node.
Hardware for your Server:
2 Cores
2mb Ram
20 Gb Disc
Software
Ubuntu 16.04
Can start with one VPS and when the chain grow changed for one dedicated server and more.
I recommended for your server
Create new sudo user
Changed the ssh port from 22 to another port.
Block ROOT in ssh
active Firewall Open port 46656, 46657, and the port you choice for the SSH.
Now you are connected to your ubuntu server with the new user no like ROOT, and have connected in other port different to 22 if you don't gonna get REKT.
Ok, Now time to build.
First you need install Golang and some tools.
sudo apt update
sudo apt upgrade -y
sudo apt-get install screen vim make wget git
wget -c 'https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz' -O go1.10.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz
sudo rm -Rf go1.10.3.linux-amd64.tar.gz
go version
The program 'go' is currently not installed. You can install it by typing:
sudo apt install golang-go
#BEWARE Is installed but you need firts
Set GOPATH
go for
vi $HOME/.profile
Add this lines to your file:
PATH="$PATH:/usr/local/go/bin"
GOPATH="$HOME/go"
PATH="$PATH:$GOROOT/bin:$GOPATH/bin"
Like
Safe your file
reload your profile setup
source $HOME/.profile
go version
go version go1.10.3 linux/amd64
Now you can run Golang commands in your server. ;)
Time to Build Cosmos Node
Install Gaia
go get github.com/cosmos/cosmos-sdk
git checkout v0.19.0
make get_tools
make get_vendor_deps
make install
gaiad version
0.19.0-c671181
gaiacli version
0.19.0-c671181
#Gaia is install, now is time to update the genesis file for gaia-6001
mkdir -p $HOME/.gaiad/config
gaiad init --name <WRITE-HERE-ONE-NAME-FOR-YOUR-VALIDATOR>
rm $HOME/.gaiad/config/genesis.json
cp -a go/src/github.com/cosmos/cosmos-sdk/cmd/gaia/testnets/gaia-6002/genesis.json $HOME/.gaiad/config/genesis.json
sudo vi .gaiad/config/config.toml
Write one name for your Validator Node
A custom human readable name for this node
moniker = "Write-validator-name"
add this persistent_peers
persistent_peers = "38aa9bec3998f12ae9088b21a2d910d19d565c27@gaia-6002.coinculture.net:46656,[email protected]:46656,[email protected]:46656,[email protected]:46656"
.
Like
Now open one screen
screen -S cosmosvalidator
gaiad start
This is your node synchronizing the blockchain
open new windows with screen command
(Ctrl + a + c)
gaiacli status
this show the last block your node is sync true, because is not ready yet. see the time in last block and wait sync: false.
When the node is sync:false is time to open your account in Cosmos
gaiacli keys add <write-one-name-for-your-account> =<key_name>
Example
gaiacli keys add meleatuto
Check your private keys
gaiacli keys show meleatuto
All your available keys
gaiacli keys list
Save your address and pubkey to environment variables for later use:
MYADDR=<your_newly_generated_address>
MYPUBKEY=<your_newly_generated_public_key>
ok, now safe this data in one paper or where do you think is safe for the future of your family.
this is Your Cosmos testnets address
cosmosaccaddr14tn99z33qa3hc36zcux3lk4dwd7psdxwfghld4
Go to
Claim some free steaks (steak is the token in testnet)
Check the balanced in your account now
gaiacli account cosmosaccaddr14tn99z33qa3hc36zcux3lk4dwd7psdxwfghld4
Now you have 1 steak in your balance and 10 FaucetToken
Congratulations your node is working and your account too.
Send Tokens
gaiacli send --amount=1steak --chain-id=<name_of_testnet_chain> --name=<key_name> --to=<destination_address>
Now maybe you want to run one Validator Node
Upgrade account to Validator
gaiad tendermint show_validator = (-pubkey=<your_node_pubkey>)
cosmosvalpub1zcjduc3q7gtarxhztvtwlke52ja44s6jzhgg6eh0usftsv6es25ruksy9v6s39r2jr
gaiacli stake create-validator --amount=1steak --pubkey=<your_node_pubkey> --address-candidate=<your_address> --moniker=satoshi --chain-id=<name_of_the_testnet_chain> --sequence=1 --name=<key_name>
Write your own data like
gaiacli stake create-validator --amount=1steak --pubkey=cosmosvalpub1zcjduc3q7gtarxhztvtwlke52ja44s6jzhgg6eh0usftsv6es25ruksy9v6s39r2jr --address-validator=cosmosaccaddr14tn99z33qa3hc36zcux3lk4dwd7psdxwfghld4 --moniker=meleatuto --chain-id=gaia-6001 --sequence=0 --name=meleatuto
You can add more information to the validator, such as--website, --keybase-sig, or --details. Here's how:
gaiacli stake edit-validator --details="To the cosmos !" --website="https://cosmos.network"
#Delegate your tokens and Active your Validator
Bond Tokens
On the testnet, we delegate steak instead of atom. Here's how you can bond tokens to a testnet validator:
gaiacli stake delegate --amount=10steak --address-delegator=<your_address> --address-validator=<bonded_validator_address> --name=<key_name> --chain-id=<name_of_testnet_chain>
While tokens are bonded, they are pooled with all the other bonded tokens in the network. Validators and delegators obtain a percentage of shares that equal their stake in this pool.
Unbond Tokens
If for any reason the validator misbehaves, or you want to unbond a certain amount of tokens, use this following command. You can unbond a specific amount ofshares(eg:12.1) or all of them (MAX).
gaiacli stake unbond --address-delegator=<your_address> --address-validator=<bonded_validator_address> --shares=MAX --name=<key_name> --chain-id=<name_of_testnet_chain>
You can check your balance and your stake delegation to see that the unbonding went through successfully.
gaiacli account <your_address>
gaiacli stake delegation --address-delegator=<your_address> --address-validator=<bonded_validator_address> --chain-id=<name_of_testnet_chain>
View the validator's information with this command:
gaiacli stake validator --address-validator=<your_address> --chain-id=<name_of_the_testnet_chain>
To check that the validator is active, look for it here:
gaiacli advanced tendermint validator-set
Congratulations, Now you have your Validator running and need go to Validator Official chat and present yourself and your intentions in the Cosmos Blockchain
https://riot.im/app/#/room/#cosmos_validators:matrix.org
Remember that it is a testnet network, prior to the launch of the real network. you must be connected to the official chat to be able to make the updates and the necessary changes in your server. The next post will be how to update the software when the new version comes out.
Well
I hope you can be a good validator fo the Cosmos Blockchain.
My Cosmos Validator infrastructure
NOTED:
Later i cant edit this post for the new testnets go to
Here the Tuto is update,
Happy Validating
Congratulations @melea! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Do not miss the last post from @steemitboard!
Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes
good article!
Thanks
melea.es is deprecated.
Here the manual update.
https://meleatrust.com/cosmos-tuto/