# Run a Validator

## Becoming a validator

Once you properly set up a full node, you can become a validator node and start earning by validating the chain transactions.

### Requirements <a href="#requirements" id="requirements"></a>

If you want to become an Empe validator you need to:

1. Be a full node and cosmovisor up. If you are not, please follow the full [node configuration guide](https://docs.empe.io/empe-blockchain/overview/configure-a-node) and [Cosmovisor setup](https://docs.empe.io/empe-blockchain/overview/cosmovisor-setup)
2. The node must be synchronized

```
emped status | jq .SyncInfo.catching_up
```

The command above should return

```
false
```

3. Own enough tokens.\
   To become a validator you need at least 2 empe tokens to create the validator, and for transaction fee. You can obtain your tokens from faucet: [https://faucet-testnet.empe.io](https://faucet-testnet.empe.io/#/)

### 1. Add wallet key <a href="#id-1-add-wallet-key" id="id-1-add-wallet-key"></a>

Inside the testnet you can use the **Ledger**, but you can also use the wallet software with the `emped`.\
However, if you wish to use **Ledger**, please add the `--ledger` flat to any command.

{% hint style="warning" %}
Please remember to copy the 12-word seed phrase in a secure place. They are your mnemonic. If you lose them you lose all your tokens and access to your validator.
{% endhint %}

Create the first wallet with the following command:

```
emped keys add <KEY_NAME>
# Enter a password that you can remember
```

The output of the command will provide the 24 words that are the mnemonic.

Create two wallets one for the validator and the second for the vesting account: example

If you are using the **Ledger** device you must first connect it to your computer, start the Cosmos application (on the device), and run the command

```
emped keys add <KEY_NAME> --ledger
# Enter a password that you can remember
```

In this case, the 12 words are not provided because they have already been configured in the **Ledger** initialization

```
emped keys add validator
Enter keyring passphrase:
Re-enter keyring passphrase:

- name: validator
  type: local
  address: empe1atqq8lmeptgn2jlx2q8r42p572yhh6lzle7vng
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A8D47crCW+YkFGduj6brpuzectp3D61xRIx/qbEGGTif"}'
  mnemonic: ""
  
emped keys add vesting
Enter keyring passphrase:
```

If you don't have tokens get some from faucet (<https://testnet.ping.pub/empe/faucet>) or ask on a validators group.

### What is a Validator? <a href="#what-is-a-validator" id="what-is-a-validator"></a>

[Validators](https://hub.cosmos.network/master/validators/overview.html) are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable or sign blocks at the same height. Please read about [Sentry Node Architecture](https://hub.cosmos.network/master/validators/validator-faq.html#how-can-validators-protect-themselves-from-denial-of-service-attacks) to protect your node from DDOS attacks and to ensure high availability.

### Create Your Validator <a href="#create-your-validator" id="create-your-validator"></a>

Your `empevalconspub` consensus public key from tendermint can be used to create a new validator by staking tokens. You can find your validator pubkey by running:

```
emped tendermint show-validator
```

To create your validator use the following command:

```
emped tx staking create-validator \
  --amount=1000000uempe \
  --pubkey=$(emped tendermint show-validator) \
  --moniker=<YOUR_MONIKER> \
  --chain-id=empe-testnet-2\
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --gas="auto" \
  --min-self-delegation="1000000" \
  --fees=20uempe \
  --from=<KEY_NAME>
```

{% hint style="info" %}
When specifying commission parameters, the `commission-max-change-rate` is used to measure % *point* change over the `commission-rate`. E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point.
{% endhint %}

You can confirm that you are in the validator set by using an explorer.

### Confirm Your Validator is Running <a href="#confirm-your-validator-is-running" id="confirm-your-validator-is-running"></a>

Your validator is active if the following command returns anything:

```
emped query tendermint-validator-set | grep "$(emped tendermint show-validator | jq .key  | tr -d \")"

```

You should now see your validator in one of the block explorers. You are looking for the `bech32` encoded `address` in the `~/.emped-chain/config/priv_validator_key.json` file.

{% hint style="info" %}
To be in the validator set, you need to have more total voting power than the 50th validator.
{% endhint %}
