Skip to content

Instantly share code, notes, and snippets.

@Validatrium
Last active June 7, 2022 10:54
Show Gist options
  • Save Validatrium/5c3bdcd45e413d3a594a03c884f52347 to your computer and use it in GitHub Desktop.
Save Validatrium/5c3bdcd45e413d3a594a03c884f52347 to your computer and use it in GitHub Desktop.
Razor node installation

Information

Tutorial created by Validatrium (more info on our projects at validatrium.com)

System requirements

  • CPU: 4 Cores
  • RAM: 4 GB
  • Disk: ~50 GB

Links

Steps

  • Pre-Install
  • Install & configure node
  • Import Key
  • Set initial stake
  • Allow delegation
  • Run node

Prerequires

  • Metamask wallet. Some Skale and RAZOR tokens on it
  • Server, with admin account

Pre-Install

# download docker
curl -sL get.docker.com | sudo bash

# create user 
useradd razor  -mU -G sudo,docker -s /usr/bin/bash
su - razor

Install & configure node

# this variable might be usefull : ) 
# fill it with ADDRESS! Not with private key!
ADDR=<your-wallet-address>


# run network node
docker run -d -it --name razor-go -v "$(echo $HOME)"/.razor:/root/.razor razornetwork/razor-go:v1.0.3-incentivised-testnet-phase2-patch2

# usefull alias. Run razor commands easier with logs
echo "
export ADDRESS=$ADDR
alias razor='docker exec -it razor-go razor --logFile razor'" >> $HOME/.bashrc
source $HOME/.bashrc

# WARNING!
# This settings could be changed
# recheck it: https://docs.razor.network/docs/stake/#set-config
razor setConfig --provider https://staging-v2.skalenodes.com/v1/whispering-turais --gasmultiplier 1 --buffer 20 --wait 30 --gasprice 0 --logLevel debug --gasLimit 2

Import Key

# import your metamask wallet
razor import 

Add initial stake

razor addStake --address $ADDRESS --value <amount>

Allow others to delegate on your node

razor setDelegation --address $ADDRESS --status true --commission 1

Start the node

Manual run

you can run in background using for example screen or tmux

razor vote $ADDRESS

As a service

sudo tee /etc/systemd/system/razord.service > /dev/null <<EOF 
[Unit]
Description=razor-vote
After=network-online.target 

[Service]
User=$USER
ExecStart=/usr/bin/docker exec -it razor-go razor --logFile razor vote $ADDRESS
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target 
EOF

sudo systemctl enable razord
sudo systemctl start razord
# check logs
journalctl -u razord -f 

Tutorial created by Validatrium (more info on our projects at validatrium.com)

If you have any additional questions regarding this tutorial, please join Razor official discord channel and tag Validatrium members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment