February 26, 2023

Installing a node in the Quasar test network!!

Quasar (pronounced QWAY-ZAR) is a decentralized appchain enabling interchain digital asset management. A digital asset can be anything from digital certificates, authentication codes, to fungible or non-fungible tokens. Management can be anything one would like to do with the digital asset such as save, co-manage, crowdsource, or crowdlend. Quasar offers a transparent, secure, and governable platform to build general purpose management containers (vaults).

minimum recommended hardware configuration :

  • 4 cores (modern CPU's)
  • 8Gb of
  • RAM200Gb of disk space
  • 10Mbps permanent internet connection

updating the server:

sudo apt update && sudo apt upgrade -y

install the necessary utilities:

sudo apt install curl build-essential git wget jq make gcc tmux chrony -y

specify the name of your validator, which will be visible in the explorer:

NODENAME=<NAME_VALIDATOR>

saving and importing variables :

echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
if [ ! $WALLET ]; then
	echo "export WALLET=wallet" >> $HOME/.bash_profile
fi
echo "export QUASAR_CHAIN_ID=qsr-questnet-04" >> $HOME/.bash_profile
source $HOME/.bash_profile

installing GO:

ver="1.19.1" && \
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" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version

clone and assemble the binary file:

cd $HOME
wget https://github.com/quasar-finance/binary-release/raw/main/v0.0.2-alpha-11/quasarnoded-linux-amd64
chmod +x quasarnoded-linux-amd64
sudo mv quasarnoded-linux-amd64 /usr/local/bin/quasarnoded

initializing the application:

quasarnoded init $NODENAME --chain-id $QUASAR_CHAIN_ID

download the genesis file:

curl -s https://raw.githubusercontent.com/quasar-finance/questnet/main/v04/definitive-genesis.json > $HOME/.quasarnode/config/genesis.json

adding peers:

SEEDS=""
PEERS="[email protected]:29656,[email protected]:29656,[email protected]:29656,[email protected]:29656,[email protected]:29656,[email protected]:26647,[email protected]:29656,[email protected]:25656,[email protected]:29656,[email protected]:29656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.quasarnode/config/config.toml

setting up pruning:

pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.quasarnode/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.quasarnode/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.quasarnode/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.quasarnode/config/app.toml

we set the minimum gas price:

sed -i 's/minimum-gas-prices =.*/minimum-gas-prices = "0.0uqsr"/g' $HOME/.quasarnode/config/app.toml

if necessary, disable indexing (indexer = "null"):

cd ~
nano $HOME/.quasarnode/config/config.toml
ctrl O, enter, ctrrl X

resetting the chain data:

quasarnoded tendermint unsafe-reset-all --home $HOME/.quasarnode

creating a service file:

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

[Service]
User=$USER
ExecStart=/usr/local/bin/quasarnoded start 
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-us
er.target
EOF

launching the service file:

sudo systemctl daemon-reload && sudo sudo systemctl enable quasarnoded
sudo systemctl restart quasarnoded && sudo journalctl -u quasarnoded -f -o cat

after the synchronization is complete, load the variables into the system:

source $HOME/.bash_profile

creating or restoring a wallet:

quasarnoded keys add $WALLET 
quasarnoded keys add $WALLET --recover

we save the information, enter the commands in turn, enter your password in 1 and 2:

QUASAR_WALLET_ADDRESS=$(quasarnoded keys show $WALLET -a)

QUASAR_VALOPER_ADDRESS=$(quasarnoded keys show $WALLET --bech val -a)

echo 'export QUASAR_WALLET_ADDRESS='${QUASAR_WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export QUASAR_VALOPER_ADDRESS='${QUASAR_VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

creating a validator:

quasarnoded tx staking create-validator \
  --amount=1000000uqsr \
  --pubkey=$(quasarnoded tendermint show-validator) \
  --moniker=$NODENAME \
  --identity="xxx" \
  --website="xxx" \
  --details="xxx" \
  --chain-id=$QUASAR_CHAIN_ID \
  --commission-rate="0.03" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --from=$WALLET \
  --fees=7000uqsr \
  --gas=150000 -y

delete node:

sudo systemctl stop quasarnoded 
sudo systemctl disable quasarnoded 
sudo rm /etc/systemd/system/quasarnode* -rf 
sudo rm $(which quasarnoded) -rf sudo rm $HOME/.quasarnode* -rf 
sudo rm $HOME/quasarnode -rf 
sudo rm -rf $HOME/quasarnoded 
sed -i '/QUASAR_/d' ~/.bash_profile