# Setting-up Juno Validator node on Testnet ## Clone git repository: ``` git clone https://github.com/CosmosContracts/juno cd juno git fetch git checkout v9.0.0 make build && make install junod version ``` We will use v9.0.0, which will sync the node till block 20000. Then, we will update the binary to v10.0.0-alpha.2 and continue syncing the node. ## Set persistant peers: ``` PEERS=ec41af656b3450050ae27559b66b877373c44861@65.21.122.47:26656,97e836cce2c83e3a1e493429efa317a3fb66b8c4@65.108.79.246:26685,e0fbaf1ef89afad23444e67b334bdf78a4b598fd@65.108.71.92:52656,8228e05a49947039b1ab9f26ac1eac3c96f56031@135.181.223.115:26656,bae287c31f9b23642be7c3c71a9420d6361807b1@95.216.101.38:26656,791875d0e15873a98657eac98c6ecace23c5c3b3@194.163.139.3:26656,9db06fae1998a14c79cb13d50152828b9fa049e9@195.201.161.122:26656,bd0c65e90ea582d45a84bf0c7a46b7eac19b3613@88.99.219.120:52656,5479526dbdf4f27aa59ddc52be9cf2614049d28e@185.216.178.75:26656,962c55015ea99f769a50c78c1cc4edf6bc174ab2@173.212.246.126:26666,15c4f14f773079de1301f1f23798ee1e0e94efcb@207.180.241.194:26656,39b02285db6a2fe87aad8f17c70e68e037bedbde@185.252.235.216:26758,c96c8e2b31bda1bde94e14dc4cbd483156d72348@194.146.25.205:26656,51f9e32a76d738c51dfa353917cef10729b6a600@161.97.118.84:26656,ac9dd6db1d34c15b1de212b0c0c240615bfc2941@207.180.243.215:26656,cfa2ae6075993fa6f97f26c29cde65cb1f214d79@167.86.82.78:16656,f79ce2fab55e56b408d76ddcbc1c82c1a90e315b@54.74.146.114:26656,62ca9e99a7c9b0957cf6e4d4d745fb9514a56ca9@167.86.81.153:16656,8db3ddafca9081d52fa6fe9ed173c008ee3f90a7@192.99.167.131:26656,f5cfce229f71997d7f4cc766909427ee76a8b4f3@38.146.3.191:26656,2e74a7d238cfdd5d03ae0bf0b2f0e50aa88e37d3@44.234.50.242:26656,56faecf352da7ecedb53fd83cf6f1d6ed1adf95a@13.38.148.24:26656,da407473e7cce06c86ed062267d4f6229a303987@190.3.87.64:26856,256a94965d448b56bd05e01eb4af082f5e65cfc2@222.106.187.14:53706,a08f7b76eb274fb453dcb8be8b237ddb90e41638@135.125.180.36:36656,1e904b6f67aff3d48c109df9767c9f2775a4a8ce@65.108.227.47:26656,ed90921d43ede634043d152d7a87e8881fb85e90@65.108.77.106:26709,edc35b09613096598e20f8508c977806093d7eec@194.61.28.217:26656,b9b1656f5a255b62a8bc093cca7dc6e9744ee841@65.144.145.234:26656,4a91597dfe3ec715bbf6def225066fbb6ad86cfe@207.180.204.112:36656,fd1e3f9baf1922f81bfd9754ddbc4269dbf08264@38.146.3.181:26656,c583f7bbfee00ca0ff0208663fe2d07014415ec9@38.242.150.175:26656,abfccd2f0935e07e3c3494f4ca2e6228e5779267@64.5.123.27:26656,ae50fb5e1b4d57aeacd15f623825b72fda210b21@159.203.187.173:26656 ``` Store it in the config.toml: ``` sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.juno/config/config.toml ``` ## Set minimum-gas-prices: ``` sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ujunox\"/" ~/.juno/config/app.toml ``` ## Initialize the Node: ``` junod init Validatus --chain-id uni-5 ``` ## Download genesis file: ``` curl https://raw.githubusercontent.com/CosmosContracts/testnets/main/uni-5/genesis.json > ~/.juno/config/genesis.json ``` ## Create systemd service file and start it: First we will create the systemd service file. ``` sudo tee /etc/systemd/system/junod.service > /dev/null <<EOF [Unit] Description=Juno Node After=network-online.target [Service] User=cosmos ExecStart=/bin/bash -c '/home/cosmos/go/bin/junod start' Restart=always RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF ``` Now reload daemon, enable the service and start: ``` sudo systemctl daemon-reload sudo systemctl enable junod.service sudo systemctl start junod.service ``` When the node sync reaches block 20000, stop the node. ``` sudo systemctl stop junod.service ``` Upgrade the binary to v10.0.0-alpha.2: ``` cd juno git fetch git checkout v10.0.0-alpha.2 make build && make install ``` Then start the node again: ``` sudo systemctl start junod.service ``` When node is completely synced, we will upgrade it to validator node. ## Create a local key pair: We will create a key pair for our validator. ``` junod keys add junotestnet --keyring-backend=test ``` Save the mnemonic and copy the address, ask for test tokens in the discord channel. ## Create Validator: ``` junod tx staking create-validator \ --amount 2000000000ujunox \ --commission-max-change-rate "0.1" \ --commission-max-rate "0.20" \ --commission-rate "0.1" \ --min-self-delegation "1" \ --pubkey=$(junod tendermint show-validator) \ --moniker Validatus \ --chain-id uni-5 \ --gas-prices 0.025ujunox \ --from junotestnet --keyring-backend="test" \ --identity="DEF3590B1DCD96A4" --security-contact="support@validatus.com" \ --website="https://www.validatus.com" \ --details "Validatus - verifying blockchain entries on purely Enterprise Linux based systems with regular security audits. Stay safe. Stake with us." ``` Check balance: ``` BALANCE=$(junod query bank balances juno123aw4ml9e3r9yjswl3ul73gj58h77ul4vp6sz0 --output=json | jq -r '.balances[] | select(.denom == "'ujunox'") .amount') echo $BALANCE ``` Claim Rewards+Comissions: ``` junod tx distribution withdraw-rewards junovaloper123aw4ml9e3r9yjswl3ul73gj58h77ul4nuvlek \ --from=juno123aw4ml9e3r9yjswl3ul73gj58h77ul4vp6sz0 --keyring-backend="test" \ --chain-id="uni-5" \ --commission \ --gas-prices 0.025ujunox \ --yes ``` Redelegate: ``` #Calculate tx amount: BALANCE=$(junod query bank balances juno123aw4ml9e3r9yjswl3ul73gj58h77ul4vp6sz0 --output=json | jq -r '.balances[] | select(.denom == "'ujunox'") .amount') TX_AMOUNT=$(expr $BALANCE - 210000) # junod tx staking delegate junovaloper123aw4ml9e3r9yjswl3ul73gj58h77ul4nuvlek \ "$TX_AMOUNT"ujunox \ --from=juno123aw4ml9e3r9yjswl3ul73gj58h77ul4vp6sz0 --keyring-backend="test" \ --gas-prices="0.025ujunox" \ --chain-id="uni-5" \ --yes ```