Run Vara Validator Node
Validators are special network participants who, if selected in an active validator set
, produce blocks for the chain. Validators receive a reward for their bets.
Running a validator on a live network is a responsible role. The validators are responsible not only for their own stake, but also for the stake of their current nominators. Nevertheless, this is an important role that is also well rewarded.
Initial Set Up
Hardware requirements
The most common way for a beginner to run a validator is on a cloud server running Linux. To do this, choose whatever VPS provider corresponds to the characteristics below.
Minimum system hardware requirements
: 2vCPUs, 4GB RAM, 100GB SSD storage
OS
: Ubuntu 20.04 or later, Amazon Linux 2 or later
Install Vara Node
Download gear
node from the nightly builds repo and unpack (choose the binary according to your host operating system):
- Windows x64
- MacOS ARM
- MacOS x64
- Linux x64
Terminal:
curl -O https://get.gear.rs/vara-nightly-windows-x86_64.zip
or
Windows x64: vara-nightly-windows-x86_64.zip
Unzip the downloaded package then you can try to run the node:
❯ gear.exe --version
gear.exe 0.1.0-a1a44748703
Terminal:
wget https://get.gear.rs/vara-nightly-macos-m.tar.gz && \
tar xvf vara-nightly-macos-m.tar.gz && \
rm vara-nightly-macos-m.tar.gz && \
chmod +x gear
or
macOS M1/M2: vara-nightly-macos-m1.tar.gz
You can try to run the node:
❯ ./gear --version
gear 0.1.0-a1a44748703
Terminal:
wget https://get.gear.rs/vara-nightly-macos-x86_64.tar.gz && \
tar xvf vara-nightly-macos-x86_64.tar.gz && \
rm vara-nightly-macos-x86_64.tar.gz && \
chmod +x gear
or
macOS Intel x64: vara-nightly-macos-x86_64.tar.gz
You can try to run the node:
❯ ./gear --version
gear 0.1.0-a1a44748703
Terminal:
wget https://get.gear.rs/vara-nightly-linux-x86_64.tar.xz && \
tar xvf vara-nightly-linux-x86_64.tar.xz && \
rm vara-nightly-linux-x86_64.tar.xz && \
chmod +x gear
or
Linux x64: vara-nightly-linux-x86_64.tar.xz
You can try to run the node:
❯ ./gear --version
gear 0.1.0-a1a44748703
Create Stash and Controller accounts
For security reasons, we recommend creating two separate accounts: Stash
and Controller
. It's important to make sure that each of them has enough funds to pay the transaction fee. Most of the funds should be stored on the stash account since it's meant to store staking funds.
To generate new seed phrase:
./gear key generate | grep phrase
Both seed phrases should be carefully saved in a secure place. If you want to use your own seed phrase, you can skip the previous step. Also you can use Polkadot.{js} or Polkadot extension
Run Node
The most convenient and easiest way to run a node in validator mode will be to use the ansible script
we have prepared.
Install ansible
- macOS:
brew install ansible
# Optional
# If you access your server using SSH login and password instead of SSH key
brew install esolitos/ipa/sshpass
- Ubuntu Linux:
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
# Optional:
sudo apt install sshpass
Next, download this Ansible playbook:
wget https://get.gear.rs/ansible/vara/install-validator.yml
Run the Ansible playbook then enter the node name and the seed phrase generated above when prompted (this node name will be visible on the telemetry site, see below):
ansible-playbook install-validator.yml -i <my-host>, -u <user> --key-file <path-to-key-file>
# use flad -k instead --key-file if you use sshpass
Wait until the playbook completes and check in Ansible log that vara-node.service has running state:
TASK [Write vara-node status] ************************
ok: [<my-host>] => {
"ansible_facts.services[\"vara-node.service\"]": {
"name": "vara-node.service",
"source": "systemd",
"state": "running",
"status": "enabled"
}
}
You can also see your node with the name you set when running the playbook in telemetry: https://telemetry.rs
Get session keys
You need to tell the chain your Session keys. If you are on a remote server, it is easier to run this command on the same machine (while the node is running with the default HTTP RPC port configured):
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933
Output:
{“jsonrpc”:”2.0",”result”:”0x5e977ddcc0c69a6aed067052d5bd8f6bd365fae03562fd447d434e9814ac415d7c9ffe722364922bda314e44654f5c0cdc00d152470d5433f12cb73d078061863ac769d5f17b5460f042d221edf0099d2ce4c23edbe96ac943452cc4d3ad6d72”,”id”:1}
The output will have a hex-encoded result
field. Copy and save it!
Setup Validator
If your node is live and synchronized, appears in telemetry, and session keys are prepared it's time to set up the validator.
Go to Polkadot.{js} app and navigate to Network → Staking → Account actions section and click +Validator
:
Select stash and controller account and specify the amount of own stake. It's recommended to use different accounts for stash and controller.
How much VARA do I need to become a Validator? Now the minimum amount of own stake to be selected equals 1 VARA. Anyhow the minimum stake that is necessary to be elected as an active validator is dynamic and can change over time.
Set the session key
and reward commission.
And sign the transaction. Make sure that you have been added to the stash account and wait for the next Era. When the next Era starts, your validator will be added.