Skip to main content

Cheat Sheet

Wallet

Add New Wallet Key

kopid keys add wallet

Recover existing key

kopid keys add wallet --recover

List All Keys

kopid keys list

Query Wallet Balance

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

Check sync status

kopid status 2>&1 | jq .sync_info.catching_up

Create Validator

Obtain your validator public key by running the following command:

kopid tendermint show-validator

The output will be similar to this (with a different key):

{"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="}
Then, create a file named validator.json with the following content:
nano $HOME/validator.json

Change your info, from "pubkey" to "details" and Save them

{
"pubkey": {
"@type":"/cosmos.crypto.ed25519.PubKey",
"key":"<Paste Key here>"
},
"amount": "1000000ukopi",
"moniker": "Node39 Guide",
"identity": "",
"website": "https://services.node39.top",
"security": "[email protected]",
"details": "Node39.TOP Member",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}

Finally, we're ready to submit the transaction to create the validator:

kopid tx staking create-validator $HOME/validator.json \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y

Delegate Token to your own validator

kopid tx staking delegate $(kopid keys show wallet --bech val -a)  1000000ukopi \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y

Withdraw rewards and commission from your validator

kopid tx distribution withdraw-rewards $(kopid keys show wallet --bech val -a) \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y

Unjail validator

kopid tx slashing unjail \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y

Services Management

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable kopid

# Disable Service
sudo systemctl disable kopid

# Start Service
sudo systemctl start kopid

# Stop Service
sudo systemctl stop kopid

# Restart Service
sudo systemctl restart kopid

# Check Service Status
sudo systemctl status kopid

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

Snapshot

sudo systemctl stop kopid 

cp $HOME/.kopid/data/priv_validator_state.json $HOME/.kopid/priv_validator_state.json.backup

kopid tendermint unsafe-reset-all --home $HOME/.kopid --keep-addr-book
# Download latest chain snapshot
curl -L https://files.nodesync.top/Kopi/snapshot-kopi.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.kopid

mv $HOME/.kopid/priv_validator_state.json.backup $HOME/.kopid/data/priv_validator_state.json

sudo systemctl restart kopid && sudo journalctl -u kopid -f --no-hostname -o cat

Backup Validator

cat $HOME/.kopid/config/priv_validator_key.json

Remove node

cd $HOME
sudo systemctl stop kopid
sudo systemctl disable kopid
sudo rm /etc/systemd/system/kopid.service
sudo systemctl daemon-reload
rm -f $(which kopid)
rm -rf $HOME/.kopid
rm -rf $HOME/kopid