βοΈ Service Commands
Check Logs
Copy sudo journalctl -u selfchaind -f -o cat
Start service
Copy sudo systemctl start selfchaind
Stop service
Copy sudo systemctl stop selfchaind
Restart service
Copy sudo systmctl restart selfchaind
Check status
Copy sudo systemctl status selfchaind
Enable Service
Copy sudo systemctl enable selfchaind
Reload service
Copy sudo systemctl daemon-reload
Disable service
Copy sudo systemctl disable selfchaind
Check synchronization status
Copy selfchaind 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
Copy local_height = $( selfchaind status | jq -r .sync_info.latest_block_height ); network_height = $( curl -s https://rpc.selfchain-testnet.unitynodes.com/status | jq -r .result.sync_info.latest_block_height ); blocks_left = $(( network_height - local_height )); echo "Your node height: $local_height" ; echo "Network height: $network_height" ; echo "Blocks left: $blocks_left"
Example:
View the ports used node
View the ports used node
Copy ss -tulpn | grep selfchaind
βοΈ Key Command
Create new wallet
Copy selfchaind keys add wallet
Recovery wallet
Copy selfchaind keys add wallet --recover
List all wallet
Delete wallet
Copy selfchaind keys delete wallet
Export wallet
Copy selfchaind keys export wallet
Import wallet
Copy selfchaind keys import wallet wallet.backup
Check wallet balance
Your balance Balance another wallet
Copy selfchaind q bank balances $( selfchaind keys show wallet -a )
Copy selfchaind q bank balances "Any other or your wallet"
βοΈ Validator Commands
Create validator
Copy selfchaind tx staking create-validator \
--amount 800000uslf \
--node https://rpc.selfchain.io:26657/ \
--pubkey $( selfchaind tendermint show-validator ) \
--moniker "" \ #Validator name, displayed in explorers.
--identity "" \ #Use your KeyBase ID. If you don 't have one, leave it empty.
--website "" \ #Any details about your validator.
--details "" \ #Your website/github etc
--chain-id "self-1" \
--commission-rate "0.05" \
--commission-max-rate "0.20" \
--commission-max-change-rate "0.01" \
--min-self-delegation "1" \
--broadcast-mode sync \
--gas "auto" \
--gas-adjustment "1.2" \
--gas-prices "0.5uslf" \
--from wallet \
-y
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:
Copy selfchaind tx staking create-validator \
--amount "1000000uself" \
--pubkey $( selfchaind tendermint show-validator ) \
--moniker "Oliver" \
--identity "" \
--details "Reliable validator for your network." \
--website "" \
--chain-id self-1 \
--commission-rate "0.05" \
--commission-max-rate "0.2" \
--commission-max-change-rate "0.01" \
--min-self-delegation "1" \
--broadcast-mode sync \
--gas= "87578" \
--gas-adjustment= "1.2" \
--gas-prices= "0.5uslf" \
--from=wallet \
-y
Update validator information
Copy selfchaind tx staking edit-validator \
--new-moniker "NODE_MONIKER" \
--identity "" \
--details "DETAILS" \
--website "YOUR WEBSITE" \
--chain-id self-1 \
--commission-rate "0.05" \
--gas= "87578" \
--gas-adjustment= "1.2" \
--gas-prices= "0.5uslf" \
--from=wallet \
-y
Validator details
Copy selfchaind q staking validator $( selfchaind keys show wallet --bech val -a )
Jailing info
Copy selfchaind q staking validator $( selfchaind keys show wallet --bech val -a ) | grep -E "jailed"
If "true" - your validator is jailed // "false" - your validator is not jailed
Jail reason
Copy selfchaind q slashing signing-info $( selfchaind tendermint show-validator )
Unjail command
Copy selfchaind tx slashing unjail \
--node https://rpc.selfchain.io:26657/ \
--gas= "auto" \
--chain-id= "self-1" \
--gas-adjustment= "1.5" \
--gas-prices= "0.5uslf" \
--broadcast-mode sync \
--from wallet \
-y
Information about delegation at your validator
Copy selfchaind q staking validator $( selfchaind keys show wallet --bech val -a ) | grep -E "tokens"
Active Validators list
Copy selfchaind 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
Copy selfchaind 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
Copy selfchaind query slashing signing-info $( selfchaind tendermint show-validator )
βοΈ Tokens Commands
Delegate to yourself
Copy selfchaind tx staking delegate $( selfchaind keys show wallet --bech val -a ) 1000000uself --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Delegate to another validator
Copy selfchaind tx staking delegate < TO_VALOPER_ADDRES S > 1000000uself --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Redelegate your stake to other validator
Copy selfchaind tx staking redelegate $( selfchaind keys show wallet --bech val -a ) < TO_VALOPER_ADDRES S > 1000000uself --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Unbond stake
Copy selfchaind tx staking unbond $( selfchaind keys show wallet --bech val -a ) 1000000uself --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Send tokens
Copy selfchaind tx bank send wallet < TO_WALLET_ADDRES S > 1000000uself --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Check wallet balance
Copy selfchaind q bank balances $( selfchaind keys show wallet -a )
Transaction details
Copy selfchaind query tx HASH_TX
Withdraw all rewards
Copy selfchaind tx distribution withdraw-all-rewards --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Withdraw rewards and commission from your validator
Copy selfchaind tx distribution withdraw-rewards $( selfchaind keys show wallet --bech val -a ) --commission --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
βοΈ Governance
List All Proposals
Copy selfchaind query gov proposals
View proposal by ID
Copy selfchaind query gov proposal ID
Vote "YES"
Copy selfchaind tx gov vote PROPOSAL_ID yes --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Vote "NO"
Copy selfchaind tx gov vote PROPOSAL_ID no --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Vote "NO_WITH_VETO"
Copy selfchaind tx gov vote PROPOSAL_ID no_with_veto --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Vote "ABSTAIN"
Copy selfchaind tx gov vote PROPOSAL_ID abstain --from wallet --chain-id self-1 --gas= "87578" --gas-adjustment= "1.2" --gas-prices= "0.5uslf" -y
Create new text proposal
Copy selfchaind tx gov submit-proposal \
--title= "Title" \ #Change Title
--description = "Description" \
--deposit "1000000uself" \
--type= "Text" \ #Change text proposal
--from = wallet \ #Change name wallet
--from wallet \
--chain-id self-1 \
--gas= "87578" \
--gas-adjustment= "1.2" \
--gas-prices= "0.5uslf" \
-y
βοΈ Utility
Set Custom Port
Copy # Change CUSTOM_PORT to any other value, or leave it as is.
CUSTOM_PORT = 34
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/.selfchain/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/.selfchain/config/app.toml && sed -i.bak -e "s%:26657%:${CUSTOM_PORT}657%" $HOME/.selfchain/config/client.toml
sudo systemctl restart selfchaind
journalctl -u selfchaind -f -o cat
Set Indexer
null kv
Copy sed -i 's|^indexer *=.*|indexer = "null"|' $HOME /.selfchain/config/config.toml
Copy sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME /.selfchain/config/config.toml
Update Pruning
Copy 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 = "17"|' $HOME /.selfchain/config/app.toml
Reset node
Copy selfchaind tendermint unsafe-reset-all --home $HOME /.selfchain --keep-addr-book
Get denom info
Copy selfchaind q bank denom-metadata -oj | jq
Get Node Peer
Copy echo $( selfchaind tendermint show-node-id ) '@' $( curl -s ifconfig.me ) ':' $( cat $HOME /.selfchain/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//' )
Update server name
Copy sudo hostnamectl set-hostname server_name
How much SSD use node (currently)
Copy du -sh $HOME /.selfchain/
How much RAM use node (currently)
Copy ps -p $( pgrep selfchaind ) -o rss= | awk '{printf("The process uses memory:: %.2f MB\n", $1/1024)}'
How much CPU use node (currently)
Copy ps -C selfchaind -o %cpu --no-headers | awk '{print $1"% CPU"}'
Delete node
Copy sudo systemctl stop selfchaind
sudo systemctl disable selfchaind
sudo rm -rf /etc/systemd/system/selfchaind.service
sudo rm $( which selfchaind )
sudo rm -rf $HOME /.selfchain
Last updated 2 months ago