Hey everybody,
I know I have created a post about doing this before, but that was all done by me researching how to do everything manually, there are commands created to help us get this set up much easier, but u need to know the right order to make it work, so that's what I'll be trying to show u all here.
For hardware I'm going to point u to this post, My SPS-Validator Tech-Stack made by @louis88.
For software u can go either way, what I will show u here will work for both Linux and macOS, the software can also run on a Windows machine and I have done this on my PC, but for making sure I was able to explain everything to somebody I tried setting up a VM with Windows on it, but I couldn't get it to work on that, so for now I'm not going to try and explain it.
U should have something looking like the screenshot below if u are doing this on a Linux or Apple, with the terminal in the centre, we'll be using this, so if u only have a terminal and not a GUI, u can still follow along.
We are going to use the README from the SPS-Validator repository, but this is where I went wrong the first time, we are going to jump in the order to get this set up as easy as possible.
The first command we are going to use is sudo apt install git-all
and press enter, we need to install git to get the software, after entering that command u can be asked to enter your password, just type it in, u will not see anything beeing typed, but it will be inputted after u press enter again. When this is done it should look something like the screenshot below.
Next step is download the software for the validator, we do this with the following command
git clone https://github.com/TheSPSDAO/SPS-Validator.git
, make sure u are in the folder u want to have the software in, as this will create a new folder in there and download all the files it needs in it. When this is done it should look like the screenstot below, before I did the ls
command, by doing that command u can see all the folders and files u have in the current folder.
Before we can move on, we first need to move in the SPS-Validator folder that was created, we can do that with cd SPS-Validator
, now that we are in the right folder we're going to make a copy of the .env-example file and name it .env, this can be done with cp .env-example .env
, to edit this file we now have 2 ways:
- If u are using a GUI, u can install gedit with
sudo apt-get install gedit
and when this is done open the .env file withgedit .env
- If u aren't using a GUI or don't want to install gedit, u can just use
nano .env
In both cases u will get something that looks like this:
Scroll down, use down arrow or page down to get to the bottom of the file, for now u don't need to change anything, but u will need to add in your HIVE username for VALIDATOR_ACCOUNT and active key for VALIDATOR_KEY, if u don't want to use your main account, u can create a new account for this and set your main account as REWARD_ACCOUNT, u will need to hold the Node License on the REWARD_ACCOUNT if u enter one, else just your main. Use Ctrl + S to save for gedit and nano, then Ctrl + X to close for nano, with gedit u can just close it with the mouse.
Now to download the requirements and install them we can just use the ./run.sh install_docker
command, this one command will do most of the work for us, when it's finished it should look like this:
At the bottom u can see that we need to re-login, if u are using a GUI this should be pretty easy, if u only have a terminal, I would just use the reboot
command, this will restart your device and achieve the same effect.
Now to build the docker image we need, we can use the ./run.sh build
command to start , when asked to replace the snapshot because it already exists press Y and enter, when this is complete it should look like this:
Now to start it up we have 2 options again, for the people that are using a GUI the command is ./run.sh start all
, for those with just a terminal or that don't want to use anything else on that device use ./run.sh start
, now u will see something like this, this is the validator starting up:
When it starts validating u will see text shoot by in your terminal, if u scroll up u should see something like this:
If the blocks to head isn't 0, then the validator is still catching up, for now then u can only wait, when it reaches 0 u can continue to localhost if u have used the start all command on the same device u have the software running or use the shared managment UI, this can be accessed from any device with internet connection and has keychain installed, in both cases u should see something like below:
Enter your HIVE account that u used for VALIDATOR_ACCOUNT in the .env file, as we will register the validator from that account, click Authorize and sign with keychain. U should get a screen that looks like this:
For now we can leave the Node URL empty and just click Register and sign with keychain. Next screen looks either like this or only the Manage Validator Node part, I had mine active before so this can be different.
Check the Active box, update and sign with keychain. For the next part it depends on how u have done things for now, if u are just using one account u can move to the Manage Votes screen, if u are using a new account, then u click SWITCH ACCOUNT(top right) and log back in with the HIVE account u have your staked SPS on and then go to Manage Votes, it should look like this:
Now u can either use the search box to find your Validator account or navigate to the next pages at the bottom as you have just registered and don't have any votes on your Validator yet, click VOTE on your account and sign with keychain, every account can vote for 10 Validators, so if u want u can vote for others now or just move on to the next part as u have your validator running, registered and voted on, but we still need to stake your LICENSES to get your LICENSE rewards.
This can be done from the qa environment for now, u should see this, but with the amount of LICENSES u have, this is a copy from a while back, so if u have only recently bought one it may not be in here:
On this screen click STAKE LICENSES, u will see a new screen where u can enter how many u want to stake, set your number, click STAKE and sign with keychain, this will have your Validator start sending check ins, to prove u have the software running and are able to earn rewards. If u move to the SPS tab u should now see the "Validator License Rewards" going up, highlighted with the red box on the next screenshot:
If this isn't the case for u, then u have encountered a known bug, to solve this we need to restart the validator software, but before we do that, we are going to teach ourself the good habit that before we do anything that could cause us to miss blocks, we set our Validator inactive from the manage nodes screen, uncheck the active box and update like we did to activate the Validator.
Now that our Validator is inactive we can restart our software, so open up your terminal and if u still see the logs from the validator, u can stop that by pressing Ctrl + C, this will not stop the software, but just the logging, see screenshot below, if u do this for any other reason then it can be started again with ./run.sh logs
, but now we don't want to see our logs as we need to give the
./run.sh restart
command, this is a wrapper to stop and start the software with just 1 command.
If this all is done without any delay then u should be catching up very soon, meaning blocks to head is 0 again, so we can activate our Validator again from manage nodes screen.
And then 1 final note I'm going to make here, validating a block for the SPS-chain means sending a custom json transaction on HIVE, a custom json transaction on HIVE is costly in resource credits, so if u want to run the validator software and validate blocks, u are going to need a good amount of staked HIVE, wish I could tell u just how much, but that all depends on how much votes u get, below u can see the transactions made by my validator account in just a few minutes. So u will need at least a few 100 HIVE staked to not run out or resource credits and start missing blocks that way.
Hope this helps more people get the software up and running, if there are any problems then please ask them in the validator-nodes channel in discord, I'm just somebody that tried to explain this all in a way that most will understand, but in that channel u will find the people that know much more about this then me.
Thanks for sharing! - @isaria
Congratulations @jef-001! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next target is to reach 300 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out our last posts: