Skip to main content

Warden Protocol -Chiado

Endpoints

APIRPCgRPC
warden.api.kgnodes.xyzwarden.rpc.kgnodes.xyzwarden.grpc.kgnodes.xyz

Explorer: https://explorer.kgnodes.xyz/warden

Installation

You should update the MONIKER, WALLET, and PORT variables in the Setting up environment variables section. Make sure the port you specify is not already in use.

Check for ports already in use by visually inspecting the output of the lsof -i -P -n | grep LISTEN command. Almost all Cosmos chain nodes use ports xx317, xx656, xx657, and xx090. Therefore, avoid using ports starting with xx if they are already occupied.

Update OS

sudo apt update && sudo apt upgrade -y

Installation of required packages

sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Installation of go (if you need)

cd ~
VER="1.21.3" # Make sure that this version does not broke any other apps you run!
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

Setting up environment variables

echo "export WARDEN_PORT="12"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Downloading and installing node

cd $HOME
rm -rf bin
mkdir -p $HOME/.warden/cosmovisor/genesis/bin/
mkdir bin && cd bin
wget https://github.com/warden-protocol/wardenprotocol/releases/download/v0.5.2/wardend_Linux_x86_64.zip
unzip wardend_Linux_x86_64.zip
chmod +x wardend
cd $HOME
mv $HOME/bin/wardend $HOME/.warden/cosmovisor/genesis/bin/
sudo ln -s $HOME/.warden/cosmovisor/genesis $HOME/.warden/cosmovisor/current -f
sudo ln -s $HOME/.warden/cosmovisor/current/bin/wardend /usr/local/bin/wardend -f
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.6.0

Initializing the node

wardend init "moniker" --chain-id chiado_10010-1

Downloading genesis and addressbook

wget -O $HOME/.warden/config/genesis.json https://snapshot.kgnodes.xyz/snapshot/symphony/genesis.json
wget -O $HOME/.warden/config/addrbook.json  https://snapshot.kgnodes.xyz/snapshot/symphony/addrbook.json

Setting seeds and peers

SEEDS="8288657cb2ba075f600911685670517d18f54f3b@warden-testnet-seed.itrocket.net:18656"
PEERS="29f4d620e763800883e0a1cd9484ae13c26edd60@95.217.35.179:50156,49a827a461fe4229cc780bdcd64446f81c081bbc@65.109.93.58:27356,8288657cb2ba075f600911685670517d18f54f3b@65.108.231.124:18656,438dbfe59ab6e1b97fc7cb3196fc80c43bc3851b@116.202.168.25:18656,a6889db081dd21407b0f4c5fc2f6816295a905ff@100.42.177.205:26656,5461e7642520a1f8427ffaa57f9d39cf345fcd47@54.72.190.0:26656,7b26de79a9d13e74987d1053055f1c88502ec852@149.50.102.86:11956,a3d08180344f2416ce1be547cd909ef78987e710@65.21.141.250:17956,3a01ed56372852ff30576d39a2b624b3d047932f@65.108.100.31:27756"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
-e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.warden/config/config.toml

Setting custom ports

Updating ports in app.toml

sed -i.bak -e "s%:1317%:${WARDEN_PORT}317%g;
s%:8080%:${WARDEN_PORT}080%g;
s%:9090%:${WARDEN_PORT}090%g;
s%:9091%:${WARDEN_PORT}091%g;
s%:8545%:${WARDEN_PORT}545%g;
s%:8546%:${WARDEN_PORT}546%g;
s%:6065%:${WARDEN_PORT}065%g" $HOME/.warden/config/app.toml

Updating ports in config.toml

sed -i.bak -e "s%:26658%:${WARDEN_PORT}658%g;
s%:26657%:${WARDEN_PORT}657%g;
s%:6060%:${WARDEN_PORT}060%g;
s%:26656%:${WARDEN_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${WARDEN_PORT}656\"%;
s%:26660%:${WARDEN_PORT}660%g" $HOME/.warden/config/config.toml

Configuring pruning settings

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.warden/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.warden/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" $HOME/.warden/config/app.toml

Setting gas and other configurations

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "25000000award"|g' $HOME/.warden/config/app.toml

Creating service file

sudo tee /etc/systemd/system/wardend.service > /dev/null << EOF
[Unit]
Description=warden node service
After=network-online.target

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.warden"
Environment="DAEMON_NAME=wardend"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.warden/cosmovisor/current/bin"

[Install]
WantedBy=multi-user.target
EOF

Snapshot

Latest Snaphot:

SizeHeigtTimeIndexer
761MB1122382024-10-29 20:30 UTCcustom: 100/0/10

Make sure to back up your priv_validator_key.json file if you've already created a validator! Resetting your node without a backup will cause you to lose access and require creating a new validator from scratch. Be careful!

The following snippets create a copy of your priv_validator_state.json and priv_validator_key.json files. Then, it copies the old private files back after copying the snapshot files. However, you should execute these commands with caution to prevent any kind of failure!


sudo systemctl stop wardend

cp $HOME/.warden/data/priv_validator_state.json $HOME/.warden/priv_validator_state.json.backup
cp $HOME/.warden/config/priv_validator_key.json $HOME/.warden/config/priv_validator_key.key.backup

wardend tendermint unsafe-reset-all --home $HOME/.warden --keep-addr-book
curl https://snapshot.kgnodes.xyz/snapshot/warden/snap_warden.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.warden


cp $HOME/.warden/priv_validator_state.json.backup $HOME/.warden/data/priv_validator_state.json
cp $HOME/.warden/config/priv_validator_key.json.backup $HOME/.warden/config/priv_validator_key.key

sudo systemctl start wardend && journalctl -u wardend -f --no-hostname -o cat

Enabling and starting the service.

# You need to inspect logs visually after the  to make sure that it is working
sudo systemctl daemon-reload
sudo systemctl enable wardend
sudo systemctl restart wardend && sudo journalctl -u wardend -f

Creating a wallet

You need to create or import a wallet to request test tokens. If you dont have any tokens, you will not be able to create a validator.

# Following command creates a new wallet.
# Copy mnemonics to a safe place
# If you lost your mnemonics you will not be able to recover this wallet.
wardend keys add $WALLET

# If you want to import a wallet using mnemonics, execute following command and enter your mnemonics
wardend keys add $WALLET --recover

# Get your keys and their addresses to request faucet
wardend keys list

Getting faucet

https://faucet.chiado.wardenprotocol.org/

Creating a validator

Before you begin:

It's crucial to ensure your node is synchronized with the network before attempting to create a validator. This ensures your validator operates with the latest blockchain data.

Checking Synchronization Status:

Use the following snippet to check your node's synchronization status. If the snippet returns false, your node is in sync and ready to proceed. However, if it returns true, your node is still catching up. In that case, please wait until the synchronization completes before creating a validator.

wardend status | jq -r .sync_info.catching_up

Creating a Validator:

The following snippet will create a validator.json file in your node's home directory. This file stores the details necessary to create your validator. While you can edit the validator.json file later, keep in mind that doing so may incur token fees. Therefore, it's important to ensure the information within the file is accurate before proceeding.

cd $HOME
# Create validator.json file
#Learn your pubkey
wardend tendermint show-validator
#Edit your validator.json file
nano /root/validator.json
{
"pubkey": yourpubkey,
"amount": "1000000000000000000award",
"moniker": "yourmoniker",
"identity": "optional identity signature (ex. UPort or Keybase)",
"website": "validator's (optional) website",
"security": "validator's (optional) security contact email",
"details": "validator's (optional) details",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
Type Ctrl+xy then press enter for saving json file.

Next Steps:

Once you're satisfied with the contents of validator.json, you can proceed with creating the validator using the information stored within the file.

# Create a validator using the JSON configuration
wardend tx staking create-validator /root/validator.json \
--from=wallet-name \
--chain-id=chiado_10010-1 \
--gas auto --gas-adjustment 1.6 --fees 250000000000000award \
--node=http://localhost:yourRPCPORT

Get Your Valoper adress

wardend q staking validator $(wardend keys show $WALLET --bech val -a) 

Delegate to yourself

You might need to update number of tokens before executing the following command.

wardend tx staking delegate valoper-adress amount000000000000000000award \
--chain-id chiado_10010-1 \
--from "wallet-name" \
--gas auto --gas-adjustment 1.6 --fees 250000000000000award \
--node=http://localhost:yourRPCPORT

Deleting the node completely (if you need)

Make sure that you backed up any required files to setup later! Do not lost your validator or wallet!

sudo systemctl stop wardend
sudo systemctl disable wardend
sudo rm -rf /etc/systemd/system/wardend.service
sudo rm $(which wardend)
sudo rm -rf $HOME/.warden
sed -i "/WARDEN_/d" $HOME/.bash_profile