Running a LTO Network node on Google Cloud
So you decided you want to be part of the LTO Network, awesome! Ow… you were already part of the Community?! Even better! Nice to meet you!
A great way to be part of the community is by actively participating as a node in the network. This blog post demonstrates the steps needed to get an LTO Network node up and running using Google Cloud, specifically using the Kubernetes Engine called Google Cloud Engine.
In this guide I’ll be skipping the part about creating wallets, having a main wallet, a staking wallet, how to lease, etc. If you want to read more about this, please check out the steps 1 and 2 in this guide.
Deploying your node on Google Cloud using the browser interface
Setting up a LTO Public Node on Google Cloud Engine is very easy. Google automates almost everything for you.
It’s quite a heavy setup for a LTO Public Node though because of the required Kubernetes cluster. In my case Google spun up a Kubernetes Cluster when running using around 12 GB of memory. Because of this requirement running a node on Google Cloud Engine will probably be quite “expensive” (You determine the value and define what expensive means :) ).
Yes, we are in the main screen. Let’s jump in immediately and click Kubernetes Engine -> Clusters.
Before you reach the above screen you might have to enable billing. This in turn will enable the GCE — Google Cloud Engine API. Please wait 1–2 minutes before continuing.
Having enabled the API when can start with our deployment. Click Deploy container.
We immediately jump into configuring our container. This does not mean we do not need networking, security, a Kubernetes cluster, etc. It simply means that Google can take care off a lot of these steps.
On the right side under Environment variables you find an important node regarding access secrets. It’s definitely best practice to use secrets to store your valuable data like password(s) and also your seed. Using secrets for your environment variables makes sure they do not show up in plain text. This guide does not use access secrets. Let me know if you want me to add this!
Let’s continue creating our deployment:
- Select Existing container image
- Image Path: legalthings/public-node
- Set your environment variables: LTO_WALLET_SEED, LTO_WALLET_PASSWORD and optionally your LTO_NODE_NAME.
Step 2 of the deployment is nothing more then naming your application. Please choose a Application name.
Now it’s time to create your deployment!
Google will take care of the deployment for you. This will take around 5 minutes. Google will start by deploying a Kubernetes Cluster. Second it will create your deployment, just like you configured and then this will spin up your pod (containing your running LTO Public node container).
Please wait for the process to finish.
Something happened, our application got deployed on our freshly created Kubernetes cluster. We are not happy though! A thing called an auto-scaler is active. We want to disable this as it makes our application run multiple times in parallel.
Click Actions → Auto-scale to open auto-scale settings.
Click on Disable Autoscaler to disable the auto-scale feature.
Back in our overview we see we only have 1 managed pod. This is what we wanted to achieve. Now let’s see how our LTO Public Node is doing by diving in the logs.
Click Container logs in the middle of the screen to jump to the logging screen.
In the logging screen you have the ability to click the Play icon to start streaming the console log of the container. You can see the blockchain being downloaded. After the blockchain has been successfully downloaded the node should start appending MicroBlocks like in the above screenshot.
That’s it. You’ve successfully mastered setting up a LTO Network public node on Google Cloud. Awesome!
Now wait for a 1.000 blocks…
Best of luck and thank you very much for contributing and being part of the LTO Network Community!