Useful commands

# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export ALIGNEDLAYER_CHAIN_ID="alignedlayer"" >> $HOME/.bash_profile
source $HOME/.bash_profile

WALLET MANAGEMENT

Add Wallet Specify the value <wallet> with your own wallet name

#Add new wallet
alignedlayerd keys add wallet

#Recover Wallet
alignedlayerd keys add wallet --recover

#List Wallet
alignedlayerd keys list

#Delete Wallet
alignedlayerd keys delete wallet

#Check Wallet Balance
alignedlayerd q bank balances $(alignedlayerd keys show wallet -a)

VALIDATOR MANAGEMENT

Please adjust , MONIKER , YOUR_KEYBASE_ID , YOUR_DETAILS , YOUR_WEBSITE_URL

#Create Validator
alignedlayerd tx staking create-validator \
--amount=10000000stake \
--pubkey=$(alignedlayerd tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$ALIGNEDLAYER_CHAIN_ID \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1000 \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=10stake\ 
-y

#Edit Validator
alignedlayerd tx staking edit-validator \
--new-moniker="YOUR MONIKER" \
--identity="IDENTITY KEYBASE" \
--details="DETAILS VALIDATOR" \
--website="LINK WEBSITE" \
--chain-id=$ALIGNEDLAYER_CHAIN_ID \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=10stake\ 
-y

#Unjail Validator
alignedlayerd tx slashing unjail --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#Check Jailed Reason
alignedlayerd query slashing signing-info $(alignedlayerd tendermint show-validator)

TOKEN MANAGEMENT

alignedlayerd tx distribution withdraw-all-rewards --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#Withdraw Rewards with Comission
alignedlayerd tx distribution withdraw-rewards $(alignedlayerd keys show wallet --bech val -a) --commission --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#Delegate Token to your own validator
alignedlayerd tx staking delegate $(alignedlayerd keys show wallet --bech val -a) 1000000stake --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#Delegate Token to other validator
alignedlayerd tx staking redelegate $(alignedlayerd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000stake --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#Unbond Token from your validator
alignedlayerd tx staking unbond $(alignedlayerd keys show wallet --bech val -a) 1000000stake --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#Send Token to another wallet
alignedlayerd tx bank send wallet <TO_WALLET_ADDRESS> 1000000stake --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

GOVERNANCE

#Vote, You can change the value of yes to no,abstain,nowithveto
alignedlayerd tx gov vote 1 yes --from wallet --chain-id $ALIGNEDLAYER_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10stake -y

#List all proposals
alignedlayerd query gov proposals

#Create new text proposal
alignedlayerd tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=100000000stake \
--type="Text" \
--from=wallet \
--gas-adjustment 1.5 \
--gas "auto" \
--gas-prices=10stake\ 
-y 

SERVICES MANAGEMENT

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable alignedlayerd

# Disable Service
sudo systemctl disable alignedlayerd

# Start Service
sudo systemctl start alignedlayerd

# Stop Service
sudo systemctl stop alignedlayerd

# Restart Service
sudo systemctl restart alignedlayerd

# Check Service Status
sudo systemctl status alignedlayerd

# Check Service Logs
sudo journalctl -u alignedlayerd -f --no-hostname -o cat

UTILITY

#Set Indexer NULL / KV
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.alignedlayer/config/config.toml

#Get Validator info
alignedlayerd status 2>&1 | jq .ValidatorInfo

#Get denom info
alignedlayerd q bank denom-metadata -oj | jq

#Get sync status
alignedlayerd status 2>&1 | jq .SyncInfo.catching_up

#Get latest height
alignedlayerd status 2>&1 | jq .SyncInfo.latest_block_height

#Reset Node
alignedlayerd tendermint unsafe-reset-all --home $HOME/.alignedlayer --keep-addr-book

DELETE NODE

sudo systemctl stop alignedlayerd && sudo systemctl disable alignedlayerd && sudo rm /etc/systemd/system/alignedlayerd.service && sudo systemctl daemon-reload && sudo rm -rf $(which alignedlayerd) && rm -rf $HOME/.alignedlayer && rm -rf $HOME/go/bin/alignedlayerd

Last updated