7. Setup local validator node
A step-by-step guide explaining how to configure a validator node
Create required accounts:
- Create a stash account
- Create a controller account
- Create a reward account
Bond stash and controller together; direct rewards to reward account.
To get a copy of the node, you have two options:
- 1.Download the porta-node binary
- 2.Clone the repository
git clone https://github.com/porta-network/porta-node.git
Once you have a copy of the node, move onto the next step.
Build the node:
Navigate to the root folder of the node and run the following command in a terminal:
cargo build --release
Start the node to begin synchronising chain data:
The following command should be run in a terminal. You must enter a name for your validator node.
./target/release/porta --chain chain-spec-padlock.json -d data/[Validator name] --name [Validator name] --validator --port 30337 --ws-port 9949 --rpc-port 9937 --ws-external --rpc-external --rpc-cors all --rpc-methods=unsafe
You will know when your node has completed synchronisation because the block number displayed in your terminal will be the same as the block number displayed on the Porta Console (https://console.porta.network/#/explorer).
While you wait for synchronisation, you may proceed to create the accounts mentioned below.
Create a stash account, controller account and, optionally, a reward account.
IMPORTANT NOTICE: SWAP TO YOUR NODE
Now, you MUST connect to your node:
Navigate to PolkadotJS Apps
Go Accounts > My Accounts > Add Account
- Follow the same process to create an account for ‘user-controller’ and ‘user-reward’. You should now have the following three accounts:
Ensure the accounts have relevant funds:
You need to ensure the following:
- 1.The stash account has the funds you want to stake
- 2.The controller account has enough funds to cover transaction fees
- 3.The reward account has more funds than the existential amount set by the blockchain
Bond stash account to controller account; delegate rewards to reward account:
- Go to Network > Staking
- Account Actions > + Stash
- Fill out the field as per the image below
You will now have your bonded accounts listed.
Generate the session keys for the validator account
Go to Developer > RPC Calls
Author > Rotate Keys > Submit RPC Call Copy the hex result.
Add the session keys for the validator account
Go to Network > Staking
Account Actions > Session Key
Paste in the hex session key
Set commission and click validate
Check everything is working and wait for the next era
Network > Staking > Account Actions > All Stashes This screen will confirm the session keys are set.
Network > Staking > Waiting This will confirm the intention to be a validator
Network > Overview This will confirm the time until the next Era
Once the new era has begun
You we see yourself in the validator list
You will notice your node producing blocks in the terminal
Eventually, you will notice your validator have a reward and being able use PAYOUT to capture that reward