Presearch

How to set-up a Presearch Node on Ubuntu Server on Google Cloud - SearchWithPresearch

By LoveCrypto | My CryptoEducation | 16 Mar 2021


Is this irony? Perhaps – but regardless, it was a fun challenge for me to figure this out. I had to adapt multiple resources and through trial and error, and a bit of frustration since no single resource seemed to quite work, below is what finally worked for me to get a Presearch Node set up and running on an Ubuntu instance on Google Cloud. I should be able to now adapt these instructions to other cloud services as the need arises. I hope it helps you all out!

(Links open in new tabs)

Prerequisites:

If you don't already have one, create an Account on Presearch HERE.

Watch the node video / Apply to get a Node and registration here: https://nodes.presearch.org/

NOTE: To Stake PRE against a Node you need a minimum of 1000 PRE. However, you can set up a node without having the PRE and can stake (and add to an existing stake) at any time. The easiest way I found to get PRE was to buy Bitcoin using Coinbase and then buy PRE in the Presearch Marketplace. (There was a wire transfer option, but that seemed like a real pain and would take a lot longer).

Create a Google Windows Cloud Server

I am using the free tier 90-day Trial for this example, but you can use any tier you want.

Go to https://cloud.google.com/free/ and sign up using your Google account.

99c241493ffcd4979c20f3f4e06e88facef01de71d5745979ea6babdb5c6fd99.png

Fill in the information. They will ask for a credit card – but do not charge you until you upgrade to one of the paid versions. This is a 90 day free trial with $300 of credits to spend on upgrades to test things out.

You will want to select Compute Engine and select VM Instances.

c8d53d838c88e3b101dd3ecb216a793a0a3211200977fb9eb6a6bc80866a4cd9.png

Wait a few minutes for the initial setup to get ready.

Click Create

5bdd69f585bbcf36e2c563965e2f298c75a90d4a575e34e427401e9e2f7416ce.png

At the minimum change the following:

Type in a Name. (I used presearch-node)

Update Boot Disk by clicking Change and selecting Ubuntu. You can use the default GB size or change. I did the Micro VM option so everything is smaller (and thus would be cheaper / month when paying).

23da7d6d16d396ca8838919f7f7364a5c8a345cc30473d79521ca5d8c01838ea.png

Click Select

Check Allow HTTP traffic and Allow HTTPS traffic.

847f95cafe5f77118fe6b2aed2fe0971a757e41647f3c60fa48756229d1d3f3c.png

Then if all other settings are to your liking click Create

5f29f00e40dddeb82ac6468783220ea2f017cc753a17cabd70f40646e2e639ef.png

Wait until your instance is created.

75c51edde63709ca6ee601b62d65d1e69ae5c0e645ee657725b01392915f47cc.png

Connect via SSH to install Docker and Install / Configure the Presearch Node:

Click the dropdown arrow next to SSH and select Open in Browser Window

8dc50624104186f40718f2056f643a3c7b87e3120c1542cd9abdeba0f36b4853.png

The Google Browser Shell will connect to a command line interface to your VM.

1c7e419c5ff4cbfc495ec3623414d753cc4c2b6e502c731f75b0d60697834d46.png

Now run the following commands at the prompts.

Update / Upgrade Ubuntu and get Docker:

7f41164fb09b576fd6159e24e83cbc77056ad658ec830756959fc6d2390e584a.png

  • sudo apt update
  •  sudo apt upgrade
    • Answer Y to the confirmation

Update the apt package index and install the packages to allow apt to use a repository over HTTPS

  • sudo apt-get update
  • sudo apt-get install apt-transport-https
  • sudo apt-get install ca-certificates
  • sudo apt-get install curl
  • sudo apt-get install gnupg
  • sudo apt-get install lsb-release

Add Docker’s official GPG key:

  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Set up the stable repository

  • echo \  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install the Docker Engine

  • sudo apt-get update
  • sudo apt-get install docker-ce docker-ce-cli containerd.io

Test success:

  • sudo docker run hello-world

Install the Presearch Node in Docker. Wherever it says “YOUR_CODE_HERE” use the registration code you have been assigned. You can find it here: nodes.presearch.org/dashboard

Add current user to docker group – otherwise you will get a permission denied error.

  • sudo usermod -a -G docker $USER

Log out (type exit) / then log back in.

Install Presearch Node Auto-Updater Service. This will configure the system to check for updates every 5 minutes.

  • docker run -d --name presearch-auto-updater --restart=unless-stopped -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --interval 300 presearch-node

Pull Presearch Node

  • docker pull presearch/node

Install Presearch Node as a service so it is always running and there is no need to manually start and stop. Be sure to put your registration code where it says YOUR_CODE_HERE

  • docker run -dt --name presearch-node --restart=unless-stopped -v presearch-node-storage:/app/node -e REGISTRATION_CODE=YOUR_CODE_HERE presearch/node

Helpful commands

See logs of output from the node:

  • docker logs -f presearch-node

to exit out of the logs press Ctrl-C

Check node status:

  • docker ps

Visit your nodes Dashboard to stake PRE, see rewards, and verify your node is up and running.

https://nodes.presearch.org/dashboard

 

 

How do you rate this article?

20



My CryptoEducation
My CryptoEducation

For this blog I will be journaling my observations, thoughts, and experiences on my educational journey through this wild and crazy crypto land. I will review the sites I have experimented on, review some of the games I play (I am particularly fascinated with NFT's within games), and share some of the strategies I am trying.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.