Before setting up your node, you need to prepare a machine that have installed dependencies.
Network settings
These following ports must be exposed to the public internet:
Port 22: for SSH
Port 5050: for TCP and UDP traffic
A custom port can be used with --port <port> flag when run your node.
Set up non-root user
If there is already a non-root user available, you can skip this step.
# SSH into your machine(local)$sshroot@{IP_ADDRESS}# Update the system$sudoapt-getupdate&&sudoapt-getupgrade-y# Create a non-root user$USER={USERNAME}$sudomkdir-p/home/$USER/.ssh$sudotouch/home/$USER/.ssh/authorized_keys$sudouseradd-d/home/$USER $USER$sudousermod-aGsudo $USER$sudochown-R $USER:$USER /home/$USER/$sudochmod700/home/$USER/.ssh$sudochmod644/home/$USER/.ssh/authorized_keys
Make sure to paste your public SSH key into the authorized_keys file of the newly created user in order to be able to log in via SSH.
# Enable sudo without password for the user$sudovi/etc/sudoers
Add the following line to the end of the file:
{USERNAME} ALL=NOPASSWD: ALL
Now close the root SSH connection to the machine and log in as your newly created user:
# Close the root SSH connection$exit# Log in as new user(local)$ssh{USERNAME}@{IP_ADDRESS}
# Export go paths$vi~/.bash_aliases# Append the following linesexport GOROOT=/usr/local/goexport GOPATH=$HOME/goexport PATH=$GOPATH/bin:$GOROOT/bin:$PATH
Finally, validate your Go installation by checking its version: