Running a Validator

Running a Validator on SPHX Testnet

Introduction

Validators on the SPHX Testnet are responsible for committing new blocks through an automated voting process. Running a validator requires technical skills and a deep understanding of network security, as validator nodes must maintain high availability and be resistant to DDoS attacks.

This guide will walk you through the process of setting up and running a validator on the SPHX Testnet.


Prerequisites

  1. Join the SPHX Testnet: Ensure you have completed the steps to join the testnet and your full node is fully synchronized to the latest block.

  2. Set Up Your Node: If you haven't already, initialize and sync a full node on SPHX Testnet. Refer to the [SPHX Testnet Setup Guide] for detailed instructions.

  3. Secure Your Node: Consider implementing Sentry Node Architecture to protect your validator against DDoS attacks.

  4. Install Validator Software: Ensure you have the necessary binaries installed for the SPHX Testnet (e.g., sphxd for SPHX).


Step 1: Initialize Wallet Keyring

To create a validator, you first need to add a wallet to your keyring. You can either import an existing wallet using a seed phrase or create a new one.

sphxd keys add <KEY_NAME>
  • Write down the mnemonic securely, as it will be required to recover your wallet.

  • Verify that your wallet was saved in your keyring:

sphxd keys list

Step 2: Fund Your Wallet

Make sure you have some test tokens to fund your validator creation. You can use the SPHX faucet:

  • Join the SPHX Testnet community and request tokens via the faucet channel or use the faucet URL: [SPHX Faucet Link].


Step 3: Create a Validator

To create a validator, ensure your full node is synced, and you have a small balance of test tokens in your wallet. Obtain your validator public key:

sphxd tendermint show-validator

Now, use the following command to create your validator:

sphxd tx staking create-validator   --amount=<amount_uosmo>   --pubkey=$(sphxd tendermint show-validator)   --moniker="<Your_Node_Name>"   --chain-id=<chain_id>   --commission-rate="0.10"   --commission-max-rate="0.20"   --commission-max-change-rate="0.01"   --min-self-delegation=<min_self_delegation>   --from=<key_name>   --security-contact="<your_email>"   --gas="auto"   --gas-prices="0.0025uosmo"

Explanation of flags:

  • --from: The key name of your wallet.

  • --amount: The amount you are staking.

  • --pubkey: The validator public key generated earlier.

  • --moniker: A human-readable name for your validator.

  • --commission-rate: The fee you charge delegators.

  • --commission-max-rate: The maximum fee you can charge.

  • --commission-max-change-rate: The max daily change of your commission rate.

  • --min-self-delegation: The minimum amount of tokens you are required to stake.


Step 4: Edit Validator Description

Once your validator is live, you can edit your validator’s description:

sphxd tx staking edit-validator   --moniker="<Your_Node_Name>"   --identity="<keybase_id>"   --website="https://yourwebsite.com"   --details="Validator Description"   --from=<key_name>   --chain-id=<chain_id>   --gas="auto"   --gas-prices="0.0025uosmo"

The --identity can be used with systems like Keybase to provide an avatar or more trusted identity verification.


Step 5: Monitor Your Validator

  1. View Validator Info:

sphxd query staking validator <validator_address>
  1. Track Signing Information:

sphxd query slashing signing-info <validator_pubkey> --chain-id=<chain_id>
  1. Check Validator Status: To verify your validator is part of the active set:

sphxd query staking validators --limit=300 -o json | jq -r '.validators[] | [.operator_address, .status, .tokens, .description.moniker] | @csv'

Step 6: Handle Common Issues

1. Unjail Validator

If your validator gets jailed (usually due to downtime), you can unjail it:

sphxd tx slashing unjail --from=<key_name> --chain-id=<chain_id>

2. Increase Max Open Files

If you encounter crashes due to "too many open files":

ulimit -n 4096

If you're using systemd, modify your service file:

# /etc/systemd/system/sphxd.service
[Service]
LimitNOFILE=4096

Step 7: Gracefully Halting Your Validator

To gracefully halt your validator at a specific block height (useful for upgrades):

sphxd start --halt-height=<block_height>

Final Notes

  • Security: If you plan to run a validator on the mainnet, prioritize node security and ensure high availability with practices like setting up Sentry nodes.

  • Slashing Risks: Validators can be slashed for downtime or double-signing. Monitor your validator carefully and react to downtime quickly.

By following these steps, you should be able to run a validator on the SPHX Testnet. If you run into issues, feel free to consult the community or documentation for troubleshooting.

Last updated