๐Ÿ’ก Useful commands

โš™๏ธ Service Commands

Check Logs

sudo journalctl -u fairyringd -f -o cat

Start service

sudo systemctl start fairyringd

Stop service

sudo systemctl stop fairyringd

Restart service

sudo systmctl restart fairyringd 

Check status

sudo systemctl status fairyringd 

Enable Service

sudo systemctl enable fairyringd 

Reload service

sudo systemctl daemon-reload

Disable service

sudo systemctl disable fairyringd  

Check synchronization status

fairyringd status | jq | grep "catching_up"

If "true" - not synchronized // "false" - synchronized

Check the latest block of your validator and the last block of the network

while true; do 
  local_height=$(fairyringd status | jq -r .sync_info.latest_block_height)
  network_height=$(curl -s https://rpc.fairblock-testnet.unitynodes.com/status | jq -r '.result.sync_info.latest_block_height')
  blocks_left=$((network_height - local_height))

  echo -e "\033[1;33m[Sync Status]\033[0m \033[1;32mNode Height:\033[0m \033[1;37m$local_height\033[0m | \033[1;32mNetwork Height:\033[0m \033[1;37m$network_height\033[0m | \033[1;32mBlocks Left:\033[0m \033[1;31m$blocks_left\033[0m"

  sleep 5
done

View the ports used node

ss -tulpn | grep fairyringd  

โš™๏ธ Key Command

Create new wallet

fairyringd keys add wallet

Recovery wallet

fairyringd keys add wallet --recover

List all wallet

fairyringd keys list

Delete wallet

fairyringd keys delete wallet

Export wallet

fairyringd keys export wallet

Import wallet

fairyringd keys import wallet wallet.backup 

Check wallet balance

fairyringd q bank balances $(fairyringd keys show wallet -a) 

โš™๏ธ Validator Commands

Create validator

# Create validator.json file
touch $HOME/.fairyring/config/validator.json

# Find your pubkey
fairyringd comet show-validator

#Open a validator.json file
nano $HOME/.fairyring/config/validator.json

#Paste this into the open validator.json file, pre-replacing all values โ€‹โ€‹that start with $ 
{
  "pubkey": {
    "@type": "/cosmos.crypto.ed25519.PubKey",
    "key": "+vMHVm134I+Rh4kNqLG/YwvQqDy+YqcZqWtgp7ABUop0="
  },
  "amount": "1000000ufairy",
  "moniker": "Oliver",
  "identity": "", 
  "website": "", 
  "security": "", 
  "details": "Trusted Blockchain validator", 
  "commission-rate": "0.05",
  "commission-max-rate": "0.2",
  "commission-max-change-rate": "0.2",
  "min-self-delegation": "1"
}

#After entering and changing all values, save the file with the key combination Ctrl + X and press Enter

#Run command create validator
fairyringd tx staking create-validator $HOME/.fairyring/config/validator.json \
--chain-id fairyring-testnet-2 \
--gas-adjustment="1.5" \
--fees 500ufairy \
--from wallet

You can leave the text after # unchanged - it's a commented hint that won't affect validator creation.

โ—ฝ Replace the following values with your own: WALLET - usually it's 'wallet', or your wallet's name. MONIKER - any convenient name for your validator, displayed in the explorer. IDENTITY - validator's avatar, displayed in the explorer. Create a KeyBase ID following the instructions or leave it empty, and it will default to a standard one. DETAILS - details about your validator, also displayed in the explorer.

Replace all necessary values indicated above with the $ sign to successfully create your validator. โ—ฝ Example:

{
  "pubkey": {
    "@type": "/cosmos.crypto.ed25519.PubKey",
    "key": "+vMHVm134I+Rh4kNqLG/YwvQqDy+YqcZqWtgp7ABUop0="
  },
  "amount": "1000000ufairy",
  "moniker": "Oliver",
  "identity": "", #if you have your identifier, replace it, or leave it blank
  "website": "", #if you have your website, replace it, or leave it blank
  "security": "", 
  "details": "Trusted Blockchain validator", 
  "commission-rate": "0.05",
  "commission-max-rate": "0.2",
  "commission-max-change-rate": "0.2",
  "min-self-delegation": "1"
}

Update validator information

fairyringd tx staking edit-validator --new-moniker "" --identity "" --details "" --website "" --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Validator details

fairyringd q staking validator $(fairyringd keys show wallet --bech val -a)

Jailing info

fairyringd q mstaking validator $(fairyringd keys show wallet --bech val -a) | grep -E "jailed"

If "true" - your validator is jailed // "false" - your validator is not jailed

Jail reason

fairyringd q slashing signing-info $(fairyringd tendermint show-validator)

Unjail command

fairyringd tx slashing unjail --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Information about delegation at your validator

fairyringd q staking validator $(fairyringd keys show wallet --bech val -a) | grep -E "tokens"

Active Validators list

fairyringd  q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " 	 " + .description.moniker' | sort -gr | nl

Inactive Validator list

fairyringd q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED" or .status=="BOND_STATUS_UNBONDING")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl 

Signing Info

fairyringd query slashing signing-info $(fairyringd tendermint show-validator) 

โš™๏ธ Tokens Commands

Delegate to yourself

fairyringd tx staking delegate $(fairyringd keys show wallet --bech val -a) 1000000ufairy --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Delegate to another validator

fairyringd tx staking delegate TO_VALOPER_ADDRESS 1000000ufairy --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Redelegate your stake to other validator

fairyringd tx staking redelegate $(fairyringd keys show wallet --bech val -a) TO_VALOPER_ADDRESS 1000000ufairy --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Unbond stake

fairyringd tx staking unbond $(fairyringd keys show wallet --bech val -a) 1000000ufairy --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Send tokens

fairyringd tx bank send wallet TO_WALLET_ADDRESS 1000000ufairy --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Check wallet balance

fairyringd q bank balances $(fairyringd keys show wallet -a)

Transaction details

fairyringd query tx HASH_TX

Withdraw all rewards

fairyringd tx distribution withdraw-all-rewards --from $WALLET --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Withdraw rewards and commission from your validator

fairyringd tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

โš™๏ธ Governance

List All Proposals

fairyringd query gov proposals

View proposal by ID

fairyringd query gov proposal ID

Vote "YES"

fairyringd  tx gov vote PROPOSAL_ID yes --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Vote "NO"

fairyringd tx gov vote PROPOSAL_ID no --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Vote "NO_WITH_VETO"

fairyringd tx gov vote PROPOSAL_ID no_with_veto --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Vote "ABSTAIN"

fairyringd tx gov vote PROPOSAL_ID abstain --from wallet --chain-id fairyring-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices  -y

Create new text proposal

fairyringd tx gov submit-proposal \
--title="Title" \ #Change Title
--description="Description" \
--deposit=1000000ufairy \
--type="Text" \   #Change text proposal
--from=wallet \   #Change name wallet
--gas-prices 0ufairy \ 
--gas-adjustment 1.4 \
--gas "auto" \
-y 

โš™๏ธ Utility

Set Custom Port

# Change CUSTOM_PORT to any other value, or leave it as is.
CUSTOM_PORT=25
sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%; s%:26657%:${CUSTOM_PORT}657%; s%:6060%:${CUSTOM_PORT}060%; s%:26656%:${CUSTOM_PORT}656%; s%:26660%:${CUSTOM_PORT}660%" $HOME/.fairyring/config/config.toml && sed -i.bak -e "s%:9090%:${CUSTOM_PORT}090%; s%:9091%:${CUSTOM_PORT}091%; s%:1317%:${CUSTOM_PORT}317%; s%:8545%:${CUSTOM_PORT}545%; s%:8546%:${CUSTOM_PORT}546%; s%:6065%:${CUSTOM_PORT}065%" $HOME/.fairyring/config/app.toml && sed -i.bak -e "s%:26657%:${CUSTOM_PORT}657%" $HOME/.fairyring/config/client.toml
sudo systemctl restart fairyringd 
journalctl -u fairyringd  -f -o cat

Set Indexer

  • null: Disables indexing, reducing the use of server resources, but does not allow fast data searches.

  • kv: Enables key-value indexing, which increases CPU and disk usage, but improves the speed of indexed data queries.

Indexing allows faster processing of requests, but can increase the load on server resources.

sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.fairyring/config/config.toml

Update Pruning

Prunig allows blockchain nodes to delete old transaction data to reduce disk space usage, while retaining the information necessary to ensure the security and operation of the network.

Pruning configuration - 100/0/10

sed -i.bak -e 's|^pruning *=.*|pruning = "custom"|; s|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|; s|^pruning-keep-every *=.*|pruning-keep-every = "0"|; s|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.fairyring/config/app.toml

Reset node

fairyringd tendermint unsafe-reset-all --home $HOME/.fairyring --keep-addr-book

Get denom info

fairyringd q bank denom-metadata -oj | jq

Get Node Peer

echo $(fairyringd yd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.symphonyd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//') 

Update server name

 sudo hostnamectl set-hostname server_name

How much SSD use node (currently)

du -sh $HOME/.fairyring/

How much RAM use node (currently)

ps -p $(pgrep fairyringd) -o rss= | awk '{printf("The process uses memory:: %.2f MB\n", $1/1024)}'

How much CPU use node (currently)

ps -C fairyringd -o %cpu --no-headers | awk '{print $1"% CPU"}'

Delete node

sudo systemctl stop symphonyd
sudo systemctl disable symphonyd
sudo rm -rf /etc/systemd/system/symphonyd.service
sudo rm $(which symphonyd)
sudo rm -rf $HOME/.symphonyd
sudo rm -rf $HOME/symphony

Last updated