# Become a Validator

Running a validator on a live network is a lot of responsibility! You will be accountable for not only your own stake, but also the stake of your current nominators. If you make a mistake and get slashed, your money and your reputation will be at risk. However, running a validator can also be very rewarding, knowing that you contribute to the security of a decentralized network while growing your stash.

Warning

It is highly recommended that you have significant system administration experience before attempting to run your own validator.

# Login to your VPS, download the install.sh file and then run it:

Bash installer for GeekCash Validator on Ubuntu 18.04 LTS x64 and Ubuntu 20.04 LTS x64

wget https://raw.githubusercontent.com/GeekCash/validator/master/install.sh
chmod +x ./install.sh
sudo bash ./install.sh

You can tail the logs with journalctl like so:

sudo journalctl -f -u geek

# Setup validator

To start, we will use the following terminology of keys for the guide:

stash - the stash keypair is where most of your funds should be located. It can be kept in cold storage if necessary.

controller - the controller is the keypair that will control your validator settings. It should have a smaller balance, e.g. 10-100 GEEK

session - the 4 session keypairs are hot keys that are stored on your validator node. They do not need to have balances.

# Generate a keypair

The requires validators to manage 4 validating keys for the Babe, Grandpa, ImOnline, and AuthorityDiscovery modules.

This is useful if our authoring keys have been generated via keypair tool. Note that the GRANDPA keys are ed25519, while the rest are sr25519.

  • Grandpa keys (ed25519)
  • Babe keys (sr25519)
  • ImOnline keys (sr25519)
  • AuthorityDiscovery keys (sr25519)

Create GRANDPA key are ed25519 with command: geek key generate --network geek --scheme ed25519

geek key generate --network geek --scheme ed25519
Secret phrase `wear praise basket blur mammal arrest winner pistol road civil fold harvest` is account:
  Secret seed:      0xabdee92059f2992da6cd702519c9ca569bcf7714a9bcc43b7c40e66dad23eefe
  Public key (hex): 0x8e7ba9270ef833229842f24a28c00c6ebe419b21eb57993aa6eda0d743c04c8a
  Account ID:       0x8e7ba9270ef833229842f24a28c00c6ebe419b21eb57993aa6eda0d743c04c8a
  SS58 Address:     2xBMSrVimvEWs8mRqfm5aQQLaErG6QkssfwWNjWVsvZRm3xp

Create the remaining keys which are sr25519 from the seed above:

export SEED="wear praise basket blur mammal arrest winner pistol road civil fold harvest";
for key in babe imonline authority; do geek key inspect-key --network geek "$SEED//$key"; done;
Secret Key URI `wear praise basket blur mammal arrest winner pistol road civil fold harvest//babe` is account:
  Secret seed:      0x5a0b3968e097579ee7fd81ea2c85be841b4e0ca9e6fe520878176b614dc9417e
  Public key (hex): 0xf2143d2b55a72d287115ef481df4d5b32c122df49bf1d0172cd74b7c0a61743e
  Account ID:       0xf2143d2b55a72d287115ef481df4d5b32c122df49bf1d0172cd74b7c0a61743e
  SS58 Address:     2zRwWfmLy4G11dGxZZtmybc1o2kj9bB61Yf64pC4JdeCZnNp

Secret Key URI `wear praise basket blur mammal arrest winner pistol road civil fold harvest//imonline` is account:
  Secret seed:      0xb37a6f806f862fe1de68690790377c9e16dcbd264113e2578e96008f7c1fa998
  Public key (hex): 0x1eded8af004698254ea84b66d479ed3440e56e5530a20bb302f4b9f944f0147f
  Account ID:       0x1eded8af004698254ea84b66d479ed3440e56e5530a20bb302f4b9f944f0147f
  SS58 Address:     2uf1YiyBwFfWYdrZGBzzC3m69QbyWchuSR6wKpAEZwd4Xz9V

Secret Key URI `wear praise basket blur mammal arrest winner pistol road civil fold harvest//authority` is account:
  Secret seed:      0x125e249db1167bd58dd45faf03dbda95997128045fc9391895a876c3e654b758
  Public key (hex): 0x52ce0fe56d981be9c6364416246cf22c5d5e77bdfc07618ac0bfba86e713a34c
  Account ID:       0x52ce0fe56d981be9c6364416246cf22c5d5e77bdfc07618ac0bfba86e713a34c
  SS58 Address:     2vq73xVESqbK1pkD4kU8TK94mRf66GgasGzE9DykJdAvdKGQ

# Inserting authoring keys

We can then submit the seed+key derivation paths (suri) and the corresponding AccountId’s for BABE, GRANDPA, ImOnline and AuthorityDiscovery keys via RPC:

curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["KEY_TYPE", "SEED", "PUBKEY_HEX"],"id":1 }' localhost:9933

The four key types you will enter individuals are:

  • babe for Babe keys
  • gran for Grandpa keys
  • imon for ImOnline keys
  • audi for AuthorityDiscovery keys

Grandpa:

curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["gran", "wear praise basket blur mammal arrest winner pistol road civil fold harvest", "0x8e7ba9270ef833229842f24a28c00c6ebe419b21eb57993aa6eda0d743c04c8a"],"id":1 }' localhost:9933

Babe:

curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["babe", "wear praise basket blur mammal arrest winner pistol road civil fold harvest//babe", "0xf2143d2b55a72d287115ef481df4d5b32c122df49bf1d0172cd74b7c0a61743e"],"id":1 }' localhost:9933

ImOnline:

curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["imon", "wear praise basket blur mammal arrest winner pistol road civil fold harvest//imonline", "0x1eded8af004698254ea84b66d479ed3440e56e5530a20bb302f4b9f944f0147f"],"id":1 }' localhost:9933

AuthorityDiscovery:

curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["audi", "wear praise basket blur mammal arrest winner pistol road civil fold harvest//authority", "0x52ce0fe56d981be9c6364416246cf22c5d5e77bdfc07618ac0bfba86e713a34c"],"id":1 }' localhost:9933

Validators should not share the same keys, even for learning purposes. If two validators have the same keys, they will produce conflicting blocks.

After running these curl commands, you should receive as output from stdout the public keys you provided (or didn't) in a JSON string. That also means the process was a success!

The validator node will need to be restarted after setting or changing GRANDPA keys.

Restart the validator node with the following command:

sudo service geek restart

# Bonding

It is highly recommended that you make your controller and stash accounts be two separate accounts. For this, you will create two accounts and make sure each of them have at least enough funds to pay the fees for making transactions. Keep most of your funds in the stash account since it is meant to be the custodian of your staking funds.

Make sure not to bond all your GEEK balance since you will be unable to pay transaction fees from your bonded balance.

It is now time to set up our validator. We will do the following:

Bond the GEEK of the Stash account. These GEEK will be put at stake for the security of the network and can be slashed. Select the Controller. This is the account that will decide when to start or stop validating.

First, go to the Staking section. Click on Account Actions (opens new window), and then the Validator button.

How to run a Validator on GeekCash

Stash account: - Select your Stash account. In this example, we will bond 1M GEEK, make sure that your Stash account contains at least this much. You can, of course, stake more than this.

Controller account: - Select the Controller account created earlier. This account will also need a small amount of GEEK in order to start and stop validating.

Value bonded: - How much GEEK from the Stash account you want to bond/stake. Note that you do not need to bond all of the GEEK in that account. Also note that you can always bond more GEEK later. However, withdrawing any bonded amount requires the duration of the unbonding period. On GeekCash, the planned unbonding period is 2 days.

Payment destination: - The account where the rewards from validating are sent. If you'd like to redirect payments to an account that is neither the controller nor the stash account, set one up. Note that it is extremely unsafe to set an exchange address as the recipient of the staking rewards.

# Generating the Session Keys

Once your node is fully synced, stop the process by pressing Ctrl-C. At your terminal prompt, it is easier to run this command

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933

How to run a Validator on GeekCash

The output will have a hex-encoded "result" field. The result is the concatenation of the four public keys. Save this result for a later step.

# Submitting the setKeys Transaction

How to run a Validator on GeekCash

Reward commission: You can specify the percentage of the rewards that will get paid to you. The remaining will be split among your nominators.

Click "Bond & Validate".

The validator set is refreshed every era. In the next era, if there is a slot available and your node is selected to join the validator set, your node will become an active validator. Until then, it will remain in the waiting queue. If your validator is not selected to become part of the validator set, it will remain in the waiting queue until it is. There is no need to re-start if you are not selected for the validator set in a particular era. However, it may be necessary to increase the number of GEEK staked or seek out nominators for your validator in order to join the validator set.

Congratulations! If you have followed all of these steps, and been selected to be a part of the validator set, you are now running a GeekCash Validator! If you need help, reach out on the GeekCash Validator chat (opens new window).