Skip to content

Instantly share code, notes, and snippets.

@oussamahamdaoui
Last active April 5, 2022 17:42
Show Gist options
  • Save oussamahamdaoui/67848731b47f8de5c6cadf797115e7e8 to your computer and use it in GitHub Desktop.
Save oussamahamdaoui/67848731b47f8de5c6cadf797115e7e8 to your computer and use it in GitHub Desktop.
Become validator for cryptozone

Set up a node

1 Get go

sudo apt-get update && sudo apt upgrade -y
sudo snap install --classic go
nano $HOME/.profile

2 Add this to the end of the file

GOPATH=$HOME/go
PATH=$GOPATH/bin:$PATH

3 clone the repo from github

git clone https://github.com/oussamahamdaoui/cryptozone

curl https://get.starport.network/starport! | bash

starport chain build

4 Download the genesis file

curl https://gist.githubusercontent.com/oussamahamdaoui/62adb9733e9ae28362c1e925ac7f7dd5/raw/5a2b9b73a0653c41f02c34bf5338cfdde951102a/cryptozone-genesis.json --output ~/.cryptozone/config/genesis.json

5 Add peers

nano ~/.cryptozone/config/config.toml

set persistent_peers="[email protected]:26656"

6 Set timeout commit

set timeout_commit = "5s"

7 Create the logs and system service

sudo mkdir -p /var/log/cryptozoned
sudo touch /var/log/cryptozoned/cryptozoned.log
sudo touch /var/log/cryptozoned/cryptozoned_error.log
sudo touch /etc/systemd/system/cryptozoned.service
sudo nano /etc/systemd/system/cryptozoned.service
[Unit]
Description=cryprozone daemon
After=network-online.target
[Service]
User=cryptozone-chain
ExecStart=/home/user/go/bin/cryptozoned start --home=/home/cryptozone-chain/.cryprozone
WorkingDirectory=/home/user/go/bin
StandardOutput=file:/var/log/cryptozoned/cryptozoned.log
StandardError=file:/var/log/cryptozoned/cryptozoned_error.log
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target

8 start the service

systemctl start cryptozoned

9 Verify that node is catching up with the blockchain.

cryptozoned status

You should see something like

{"NodeInfo":{"protocol_version":{"p2p":"8","block":"11","app":"0"},"id":"c9baa418c88f94269c0e2fbf17ab94bc461fd7ca","listen_addr":"tcp://0.0.0.0:26656","network":"cryptozone-1","version":"0.34.14","channels":"40202122233038606100","moniker":"mainNode2","other":{"tx_index":"on","rpc_address":"tcp://127.0.0.1:26657"}},"SyncInfo":{"latest_block_hash":"D23BD5A30FA498632847AD384C940AA0B91683EB7EDF11F486C09441FBEBB33E","latest_app_hash":"CFBF4B8AE1A12A2EBD00DDBF0471ACF7E1FFF783B5D00DD5EBDCF2E5B9AB1E73","latest_block_height":"17485","latest_block_time":"2022-01-21T17:16:48.996291925Z","earliest_block_hash":"8AA46007581FCF492AE959F1BC8BD284E4CD25E729CCD5733CAC0CB11B433F90","earliest_app_hash":"E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855","earliest_block_height":"1","earliest_block_time":"2022-01-19T21:03:06.993413234Z","catching_up":true},"ValidatorInfo":{"Address":"48764717C977E9F7ECB35C1C763A1B14584BB63E","PubKey":{"type":"tendermint/PubKeyEd25519","value":"jEz9eCOlp0aako3YbOHCjluDX2Oa4j5C4/orbzn/1/4="},"VotingPower":"0"}}

10 Wait until your node is synced with the block chain

when running cryptozoned status you shoud see "catching_up":false

11 Create a key make sure you save the memonic

cryptozoned keys add [keyname] --keyring-backend os

12 Run this to become a Validator

cryptozoned tx staking create-validator  
--amount=[amount]ucrzs   
--chain-id=cryptozone-1   
--commission-rate=[rate ex:"0.05"]
--commission-max-rate="0.20"   
--commission-max-change-rate="0.01"  
--pubkey=$(cryptozoned tendermint show-validator)   
--website="your website url"
--from=[keyname] 
--min-self-delegation=1 
--keyring-backend os
--moniker "validators name"

you can always use cryptozoned tx staking create-validator -h to see all available params

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment