Photo by Jon Moore on Unsplash

How to set up a meter.io validator in most economical way?

Ron Liu
Entering Blockchain
5 min readJun 4, 2022

--

Few months ago, my friend recommended the meter.io chain. I am interested by its new concept of stable coin. Most of the stable coins are pegged to fiat currency, while meter.io pegs the electricity fees. In my opinion, the later one makes more sense to be a “stable coin” to the physical world.

And that’s why I want to step further to set up a meter.io chain validator.

Why did I write another article about how to set up a validator?

I followed the document, but I stucked, I asked the community, tried a couple ways and finally set up the node successfully but it took me nearly a week to achieve.

I want to share my journey to help other people when setting up new validators or moving their validators to the recommended PASS provider to save the cost.

There existed both official and community ways listed in the meter.io document.

The official way is very clear and well maintained, but a little bit verbose and too generic. There is no recommended infrastructure. I mean we have to choose where (which PAAS) to start with.

The community way goes with a well maintained handy script. This article is very well written and I learned a lot. However there are some improvements as below, IMO.

  • It goes with an opinionated infrastructure, AWS Lightsail. AWS Lightsail works for many people, and so does myself. However, in my case, the medium sized machine (cost $40/month), recommended by the author, caused unexpected halting issues. I have to upgrade to the next level machine (cost $80/month) to fix it. I felt this solution is not economical enough after 1 year since the document was written.
  • In the article, it needs an extra step to automatically upgrade the main container. But I found this step is already included in the handy script with -d.
  • This article used the Italian AWS UI screenshot, which makes most English readers a bit hard to follow.

With my experience to set up the validator. It ends up costing only $12/month with higher hardware configuration and bandwidth. And the installation steps is much easier as well.

Here we go (For new validator)

This section is to create a new validator. For users want to switch from AWS Lightsail to Contabo, please read the next section.

Firstly, I recommend setting up the node in Contabo, which is a Germany Infrastructure company. Contabo VPS outperformed all the other cloud providers I knew.

Step1: Visit Contabo site, choose View all Cloud VPS

Contabo home page

Step 2: Select CLOUD VPS M

Step 3: Config the server

Nearly choose all the default settings, but be sure choose:

  • 400GB SSD
  • Ubuntu v20
  • Remember the password which will be used to login the server

Step 4: Fill in your contact and payment details

Step 5: Welcome email comes

It will say it will take up to 3 hours to setup the machine, but actually in my case it only took 10 minutes before the next email comes.

Step 6: Login details email comes

In this email, it provides the following information:

  • Your admin portal url and the login details
  • Your selected VPS IP address

Great! So far you get the server running and ready to install the meter validator docker container there.

Step 7: Login the server

Open the terminal in your desktop

ssh root@{VPS IP Address in Step 6}

When it prompts the password, enter the password you typed in Step 3.

Step 8: Install the node

Run the following command, or visit this repo .

bash <(wget -q -O - https://raw.githubusercontent.com/daveodwyer/meter-node-creator/production/node-creator) -dfw

There are many things happening behind the hood, like install docker engine, run a docker container, sync the blocks, and install a watcher to update the container automatically.

This command will run probably more than 12 hours. During the installation time, it will reboot, after that we need to run the above command again and it will pick up where it stops.

Step 9: Open ports

We need to open the following ports to be a health node.

# Check via ufw status
ufw status
# Enable ufw if it is inactive,
ufw enable

ufw allow 80/tcp
ufw allow 8332/tcp
ufw allow 8345/tcp
ufw allow 8346/tcp
ufw allow 8669/tcp
ufw allow 8670/tcp
ufw allow 8671/tcp
ufw allow 9100/tcp
ufw allow 9109/tcp
ufw allow 11235/tcp
ufw allow 55555/tcp

# Finally check if it is enabled and all the rules are setup
ufw status

Step 10: Find out the Public Key of the node

In the server, run the following command, and it will popup a public key.

cd meter_main_data
ls -l
sudo cat public.key

Step 11: Make sure the node is synced fully

To verify, we just need to check the recent block number on the node is same as on the Meter Explorer.

Visit Meter Explorer, find the recent block number.

Find out the recent block number by running the following query against your server.

curl -X GET "http://{Your node IP Address}:8669/blocks/best"

If the above two numbers are different less than 10 (The block time in meter.io is 2 seconds), your node should be already synced.

Step 12: Register as a Candidate

Visit the staking site, connect wallet.

Click New Candidate button, and fill the popup form as below

If all good, you should set up the validator successfully already.

Here we go (For existing validator on other PAAS)

Do the above Step 1- 11.

Step 12: Change the validator IP

Visit the staking site, connect wallet.

Find your validator, and choose Update, in the pop-up form, change IP and Public Key, then click Submit.

Update your validator’s IP

Hope you enjoyed reading this article, and also also hope you enjoyed setting up or moving your validator by saving some cost. If you have any questions please put in comment.

If this article helped, please follow me. Thank you.

--

--