I saw call of Scorum team member Dasha calling for people to become Scorum validators and decided to try setup test machine to see if I can setup it and become one and to gain some more knowledge about what it is, how it works and what can be possible reward. Here is how I did it and what I discovered. Worth mentioning is that I am not new on GNU/Linux and that I have some previous experience with this operating system especially with Debian based distributions which I use even on my Desktop computer.
Manual for this is on this web site https://www.scorum.network/news/validator-guide, but it need update:
I must express special thanks to user remiibs from Inter Blockchain Services https://ibs.team without whose help I'd never end up this task because this tutorial of scorum team is not up to date and accurate.
Tutorial mentioned it is for Ubuntu 20, but it should work for Debian too. So I went to server hosting company, hired cheepest VPS which satisfies minimal requirements, installed Ubuntu 20 there, enabled secure shell ssh access via secure key, secured it a little with firewall rules and fail2ban script, forbid root login and was ready to start with this tutorial. First ensure you have git and make installed.
If you don't have them, install with apt like root:
apt install -y git make lz4
Like root user i added user scorum and added it to sudoers and like tutorial said I become scorum user with su command.
adduser scorum
adduser scorum sudo
su - scorum
Next step was to download go-lang
Tutorial said remove previos version if it exist and extract it with tar command in /usr/local folder, but alas user scorum has no rights to write in /usr/local and it throws multiple "Operation not permited errors". Also go version on tutorial is outdated.
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.7.linux-amd64.tar.gz
So don't use above command but do this bellow like root user instead:
rm -rf /usr/local/go (if it has nothing to delete directory doesn't exist you are fine)
Download newer version of go lang from here: https://go.dev/dl/
Pick up 1.22 and version appropriate for your architecture from here:
For me it is this:
https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
It is working with 1.22.5 too so you can pickup the newest too.
Then like root user do this to extract it in /usr/local/ directory.
tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz
Ensure path toward go is in user's PATH variable and that it will be there after you logout and log in. Return to normal user with
su scorum and do this like that user.
export PATH=$PATH:/usr/local/go/bin
echo export PATH=$PATH:/usr/local/go/bin >> ~/.bashrc
Check your go version with:
go version
As scorum user do
rm ~/.network
to ensure there is no such file inside your home. If it says file does not exist you're fine.
cd to home directory of scorum user with
cd ~
Do git clone to get scorumdcode and cd to cosmos-network directory
git clone https://github.com/scorum/cosmos-network
cd cosmos-network
Thanks to remiibs I learned I should do this after:
git checkout v1.0.2
Then install scorumd with
make install
After this you need to change your $PATH again as scorumd command is in that folder.
nano /home/scorum/.bashrc
then ensure line with export PATH has this on the end:
:/home/scorum/go/bin/
Then do ctrl+o to save file and ctrl+x to save it.
You need also to add it in PATH for current session with
export PATH=$PATH::/home/scorum/go/bin/
You can also copy scorumd from there into /usr/local/go/bin/ folder which is already in the path.
then check your scorumd version with this command as scorum user:
scorumd version
Congratulations, you ended phase 1 of this.
Now comes tricky part. Instead what manual says do this:
scorumd init NameOfYourValidator --chain-id scorum-1
Notice --chain-id scorum-1 which is missing in original tutorial which makes you end up in errors saying expected scorum get test blah blah. I decided to name my validator as PaulBreitner so I did:
scorumd init PaulBreitner --chain-id scorum-1
do cd ~ to return in /home/scorum/
Then do this to add your key. Name of my key is PaulBreitner same what I used above. It does not need to be the same. It could be HarryKane.
/home/scorum/go/bin/scorumd keys add PaulBreitner --recover -i
Without recover it will create and import key with that name.
In case of recover command will ask you for 12 word passphrase (if you setup wallet for that you know that), I setup separate kerpl wallet extension in other browser for this and entered it. It will also ask you for keyring phrase which you will need to type when you manipulate with that key.
If you don't have key you do that comand without --recover and it will create key for you.
I then converted 1 SCR I have on that account to SP with
/home/scorum/go/bin/scorumd tx scorum convert-scr2sp 1000000000 --from PaulBreitner --fees 200000gas --chain-id scorum-1
Notice 1000000000, that's in nano Scorum or nscr. It has 9 zeroes.
Then do this to get genesis.json file from here:
wget https://raw.githubusercontent.com/scorum/cosmos-network/main/genesis/mainnet/genesis.json
Move genesis.json file you downloaded into hidden directory .scorum/config
mv genesis.json .scorum/config/
Then edit configuration file
nano ~/.scorum/config/config.toml
Ensure you change this line and ensure everything is in one line and not like here:
persistent_peers = "7ef17f1ce5416c6f71a0b0767ee2018ad6d6fb49@161.97.170.39:36656"
You can leave seeds = "" and save and exit with ctrl+o and ctrl+x.
Let's prepare service for automatic start with editing this file:
nano /etc/systemd/system/scorumd.service
[Unit]
Description= Scorum Validator
After=network-online.target
[Service]
User=scorum
ExecStart=/home/scorum/go/bin/scorumd start --home /home/scorum/.scorum
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
save it ctrl+o and exit ctrl+x.
As far as I understand this is quick way to delete and sync with database:
scorumd tendermint unsafe-reset-all
curl -o - -L https://snapshot.ibs.team/Scorum/goleveldb/data_block-2444788.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.scorum
Attention. File will have different name in future, you go to https://snapshot.ibs.team/Scorum/goleveldb/ to check the newest file.
Everything should be ready and you can start service with:
systemctl start scorumd
Hopefully you will not get error. You can check if service is running with
systemctl status scorumd
You can watch log file with:
journaltcl -u scorumd.service -f
You are not validator yet! You need to add one!
scorumd tx staking create-validator --amount=10000000000nsp --pubkey=$(scorumd tendermint show-validator) --moniker="PaulBreitner" --website="" --details="" --commission-rate="1" --commission-max-rate="1" --commission-max-change-rate="0.01" --min-self-delegation="1" --from="PaulBreitner" --chain-id="scorum-1" --gas=auto --gas-adjustment=1.4 —fees=300000gas
In from field is key name in moniker is how you want others to see your validator.
If everything is all right you should see yourself here: https://cosmos.scorum.com/scorum/validators
like PaulBreitner sees himself. You can see your validator address.
I really struggle to understand gas concept here because I tried to add more SP like 9 and hardly succeed after remiibs tried multiple times. I believe command which worked was:
scorumd tx staking delegate scorumvaloper16epml3n9qd94pthztcf4vsz0awsjdgjh4hj2ny 9000000000nsp --chain-id scorum-1 --from PaulBreitner --gas=auto --gas-adjustment=1.4 --fees 300000gas
I got plenty of errors regarding not having enough gas fee, despite keplr wallet shows I have 1000000, but command says I don't have enough for transaction which should charge around 250,000 or 300000. Remiibs did some magic with -fees and --gas=auto switches and I added 9 more SCR so I have 10 now.
As you can see Scorum team has 10 validators with 750,000 SP which are big whales, so with 10 SP I am just plankton here. I can confirm that on lowest CPU 4 GB of memory and 100GB SSD hard disk rewards for me are approximately 43000 nscr per hour. As Remiibs said if I had 100 SP it would be x10 because reward depends of SP staked or "voting power". He also warned me if I have too low specs I could miss some blocks and be eliminated from list in case of higher usage, but so far I didn't see any load or problem on this VPS I took. He also told there is no way others can vote for me as delegate because this is not ready yet. If I understand correctly if other vote and stake SP on me I'd get bigger reward and they'd have their share of it.
You can check your rewards with:
scorumd query distribution commission yourvalidatoraddress
I got two more VPSes to install prometheus and grafana to monitor validator. Tutorial for that is here https://artifact-staking.medium.com/setting-up-validator-monitoring-for-cosmos-sdk-blockchains-8ee1676eb4b0, but beware json file from tutorial is not for scorum, but remiibs gave me proper json file for scorum and I've got nice graphs:
Those 7 I missed was because I shut down validator by mistake for couple of moments I believe.
It was nice experiment. If someone from Scorum team can explain gas concept it would be highly appreciated. Keplr wallet says I have million of GAS, but I can't delegate SP to myself because I don't have enough gas says error. How do you obtain gas, why I don't have enough if transaction requires 300000 and I have 1000000 ? Thank you in advance.
Comments