(Out of Date) BYoN — Setting Up Your VPS Server

Lex Luther
5 min readFeb 14, 2021

*** NOTE: BYoN nodes are on hold till further notice and can’t be submitted. Document for historical use only…….

Part 3: Installing GETH software on your VPS server for your BYoN nodes

Estimated Completion Time: 10–120 min

This is the last of three pieces created to assist you in the process of preparing your own BYoN (Build Your own Node) node for the StrongBlock.com platform. This last section includes two separate options for installing the GETH (Go Ethereum) software on your VPS units. If you’ve made it this far, you’ll be able to complete either one.

Install Options

  1. Manual: With this option you will need to interact with your VPS through PUTTY throughout the process. You will be copying, pasting, and typing many commands to complete the process. If you’re not familiar with Ubuntu, or similar Linux OS, it will likely be a learning experience…
  2. Automated: With this options we have take of over 95% of this part for you. You’ll simply need to run a few commands in your VPS…

Once you have decided upon an install method, you can always try a different method on a future node.

If you start with the ‘Manual’ method and then change your mind, you can always ‘reinstall’ (5 min, see below) your VPS and use ‘Automated.’

Log into PUTTY

  1. First, you will need enter your IP address into PUTTY.
  2. Once your ‘terminal’ opens, login as ‘root’ and use the ‘password’ found in the “Your login data!” email from Contabo.
In PUTTY, you can name and save each VPS units IP information for easier access later if you choose

For both install methods, you will need to start the process logged in as ROOT

Automated Method

Follow these simple steps, being careful to enter the correct information.

Run these lines, one at a time, from ROOT on a fresh VPS:

apt update && apt upgrade -ycurl -O https://kryptolex.com/GETHsetup.shbash GETHsetup.sh

When prompted for input try to follow the example formatting. Spaces and special characters may not be allowed and will cause issues.

If “curl” doesn’t work, try “wget https://kryptolex.com/GETHsetup.sh” instead.

If you make an error that can’t be fixed, ‘reinstall’ and start fresh (see below).

Done-Congrats! Your node is now syncing. Visit your node on Morty’s Dashboard (https://strongstats.mortysnode.nl/) Once your node is fully synced, you may then submit it on the StrongBlock App.

Manual Method

Carefully complete the following steps, being careful to replace any highlighted example text with your own information.

Notepad, or similar text editor, and the replace tool are your friend…

Highlighting in PUTTY auto-copies (don’t right click!)

Right click in PUTTY then auto-pastes (takes getting used to…)

  1. Update the system:
apt-get updateapt-get upgradeapt updateapt upgrade 

2. Add your user (replace username with one of your choosing):

useradd -c "username" -d /home/username -m -s /bin/bash usernameecho "%username ALL=(ALL:ALL) ALL" > /etc/sudoers.d/usernamechmod 440 /etc/sudoers.d/usernamepasswd usernamereboot

If you can logon successfully with your own user do this:

sudo passwd --lock root

3. Configure firewall:

sudo apt-get install ufwsudo ufw default deny incomingsudo ufw default allow outgoingsudo ufw allow sshsudo ufw allow 30303/tcpsudo ufw enable

4. Install GETH:

sudo apt-get install software-properties-commonsudo add-apt-repository -y ppa:ethereum/ethereumsudo apt-get updatesudo apt-get install ethereum

5. Configure GETH as a service (replace nodename with your own):

geth --cache=8096 --maxpeers=100 --http --http.addr 0.0.0.0 --http.vhosts "*" --ws --ws.addr 0.0.0.0 --ws.origins="*" --ethstats nodename:STRONG4EVER@strongstats.mortysnode.nl:3000 --nousb dumpconfig > config.tomlnano startgeth.sh

copy the following into the text editor you just opened:

geth --config config.toml 2> geth.log

Save and exit out of the editor with Ctrl-X and then Y to confirm saving.

sudo nano /lib/systemd/system/geth.service

copy the following into the text editor you just opened and replace username with your username:

[Unit]
Description=Ethereum go client
[Service]
User=username
Type=simple
WorkingDirectory=/home/username
ExecStart=/bin/bash /home/username/startgeth.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target

Save and exit out of the editor with Ctrl-X and then Y to confirm saving.

sudo systemctl enable gethsudo systemctl start geth

Geth should be running now, let’s make sure:

tail -F geth.log

This should give you a nice running list of syncing blocks. Get back to the cmd prompt with Ctrl-c.

6. Install NGINX:

sudo apt install nginxsudo systemctl start nginxsudo systemctl enable nginxsudo nano /etc/nginx/conf.d/geth.conf

copy the following into the text editor you just opened and replace yournodehostname with the A-Record of your node:

server {
listen 80;
listen [::]:80;
server_name yournodehostname;
location ^~ /ws {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8546/;
}
location ^~ /rpc {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8545/;
}
}

Save and exit out of the editor with Ctrl-X and then Y to confirm saving.

sudo rm /etc/nginx/sites-enabled/defaultsudo add-apt-repository ppa:certbot/certbotsudo apt updatesudo apt install python3-certbot-nginxsudo ufw allow 'Nginx Full'

When created a certificate for your node the A-record needs to be pointing to the IP of your VPS, otherwise the next step will fail (fill in a valid e-mail when prompted and replace yournodehostname with the A-Record of your node) :

sudo certbot --nginx -d yournodehostname

When prompted select 2 to redirect all traffic to HTTPS.

sudo nginx -s reload

And that’s it, you’re done, GETH is installed as a service and should be syncing nicely in the background, your endpoints are secured and certified and you’ve been added to StrongStats, now all you have to do is create the JSON file for your application and wait for the sync to finish.

For that JSON file your endpoints are:

"rpc_endpoint": "https://yournodehostname/rpc",
"ws_endpoint": "wss://yournodehostname/ws"

End of Manual Method

‘Reinstall’ VPS

If you find you need a ‘re-do’ you can always very easily have your Contabo VPS unit format and reinstall the OS for you.

  1. Visit the VPS Control panel at Contabo at https://my.contabo.com/vps#
  2. Find the correct IP and click the ‘PC’ icon, under the ‘reinstall’ header
  3. Paste the ‘password’ for ROOT into the password field and ‘start.’
  4. Your unit should be ready in about 5 minutes, then start over…

Congratulations!! You’ve now finished this portion of your setup….

Next, proceed here, and continue on with Step #2.

If you need assistance on the above steps, visit our support page for help….

Articles in this Series, click any to go there……

  1. BYoN — Get Ready
  2. BYoN — Setting Up Your Domain
  3. BYoN — Setting Up Your VPS (This Article)
  4. Tips & Cheat sheet

StrongNodes Community Site — https://strongnodes.com/

Official StrongBlock Telegram — https://t.me/strongblock_io

Community Node Telegram — https://t.me/strongblocknodes

Community Discord — https://discord.gg/EDghBuKUXj

--

--

Responses (1)