Zero to Witness: Part 1: We need a big computer!

in #witness2 years ago (edited)

Welcome to my brand new series!

Since starting to write my Shader Programming series, I've really come to love the concept of Steem.

It makes sense to start thinking about the next step; in this series, I'm going to take you along with me on my own journey to become a Steem Witness.

There are a lot of guides around, but most are either a little outdated, or at least assume some level of familiarity with Linux and the command line.

Across this whole series, I'll try not to assume any particular knowledge, and will explain technical terms and other lingo as it's introduced. Hopefully, I can make it relatively painless for you to join me as we explore this path together. Let's go!

The basic idea: A big computer!

big_computer.jpg

Steem witnesses secure the blockchain by running Witness Nodes, and can be rewarded by receiving block rewards when new blocks are created that they have "witnessed".

In practical terms, that means we're going to need a big computer that we can leave running 24/7.

Although the process of witnessing blocks is how new Steem coins are minted, and is analogous to "mining" on other blockchains, a Witness Node doesn't need to perform any proof-of-work task and so the machine we build will be fairly power efficient. It won't need a particularly huge PSU, and it won't need an expensive graphics card. In fact, it won't need a graphics card at all.

PC-under-a-desk vs "proper" hosting

Certainly, one way we could approach this would be to build a custom PC for the task, which would need to be left running all the time and connected to the internet via our usual domestic router.

However, that means a large initial financial outlay, and our node would be reliant on domestic power and internet connectivity -- not ideal when you're aiming for "five nines" uptime (99.999%), which we definitely want!

A much better idea is to rent a computer at a datacentre. If you're not used to doing this and the idea sounds daunting, it can be a lot cheaper than you might initially think, so read on.

By using a hosting company, they are responsible for the hardware, the power, and the network connectivity.

Sounds good! But having decided to use a hosted service, we still have another choice to make. Do we want a virtual machine, or a dedicated server? By the way, "server" is simply a word for any computer that will be providing a service, but the words "computer", "machine" and "server" are largely interchangeable.

Virtual machines

Under the virtual machine (VM) scenario, we don't actually rent a physical computer at all; instead, a particularly powerful machine hosts many emulated computers, and it's one of those emulated machines that we rent.

Virtual machines are sometimes also referred to as "cloud servers" or "virtual private servers", but these are all exactly the same thing.

Because of economies of scale, VMs are quite cheap.

From a software perspective, a VM is completely equivalent to a normal computer. We can install the operating system of choice that we want on it, we get full administration-level ("root") access, and can run whatever we want.

A VM hosting package will typically include a guaranteed amount of RAM on the host computer that's only available to our own VM. The package may also promise a given number of guaranteed CPU cores -- but the sad fact is that your VM still ends up competing for resources with all the other virtual machines running on the big physical machine.

A particular resource contention is often when doing disk access (ie, loading or storing data). In our case, handling a large blockchain, that can be a bit of a problem.

Dedicated server

The other option when using a hosting company is to rent a dedicated machine. That's exactly what it sounds like; somewhere in a given rack in a given datacenter, there's an actual, physical, 19" rack-mounted computer that is exclusively for your use. It might look a bit like the one in the pic at the top of the article, which is part of my home lab network, but you'll never get to actually see your dedicated machine.

Unsurprisingly, compared to a VM this option costs a little more. However, all those juicy resources are ours and ours alone. We get to use all the CPU cores, all the RAM, all the diskspace and bandwidth, all at once and all the time. And we don't need to buy the machine, we're only renting it!

If we wanted, we could even create multiple virtual machines running on our big beast of a box.

I think it's clear which option I'm steering us towards here. But let's make a direct comparison.

Where's the sweet spot?

For probably 90% of applications, if you were in the market for your first server, I'd tell you to grab a cheap and cheerful generic VM for 10 EuroDollarPounds (also known as international beer tokens) a month.

That would be ideal if you were looking to set up a few websites, or run a private Minecraft server.

However, our use-case is a little bit special. Steem has been running for several years, and generates a new block every 3 seconds. That adds up to a LOT of data; in fact, we can assume we're going to need close to 700 gigabytes of disk space for our Witness Node.

So that Steem can hold as much data in memory as possible to keep everything nice and snappy (remember, 3 second block times!), we're also going to need a decent amount of RAM - let's say 32Gb at minimum.

Let's take these specs to a popular European hosting company: Hetzner. Their reviews are a little spotty, but their prices are great. Personally I have found them to be reliable, and on the infrequent times I have needed support they have been efficient and courteous. Note that I don't work for them and there are no affiliate links in my articles.

To look at their VM offering first (they call it "cloud") take a look here. Oops -- you'll see that you can scroll all the way to the bottom before hitting our RAM requirement, and even then we would be severely lacking in storage and would need to add an extra disk; an additional expense.

This is very typical no matter which provider you look at. Here's OVH's VM prices as another common example.

So in our case, this is actually an easy choice. For the amount of grunt we need, we're going straight to dedicated. But here's the shock: Check out Hetzner's dedicated server prices for their AX line and you'll see that they're really not as expensive as you might expect. In fact, we can meet our spec while not spending much more at all than we would on a VM with upgraded storage.

The AX51-NVMe looks ideal for us:

CPU: AMD Ryzen 7 3700X (beast mode activated!)
RAM: 64Gb DDR4 ECC (double our spec; DDR4 means it's fast; ECC means it's proper, error-correcting, datacenter-quality)
DRIVES: 2 x 1Tb NVMe SSD

A note about those drives: They use the latest NVMe interface, so they're very fast. However, don't be thinking we're going to end up with 2Tb of usable space like I expected the first time I ordered an AX51. These drives are locked into RAID 1 configuration to guard against data loss; each drive mirrors the other, so we see 1Tb of usable space.

Let's buy it!

The AX51-NVMe is ideal for us, and at 64 international beer tokens a month, is affordable. I've gone ahead and ordered one! I didn't take any additional upgrades on the package at this point, as I think we can get our Witness Node running in 1Tb of disk. I picked Helsinki as the location, which was a little cheaper.

For the pre-installed operating system, I chose "Ubuntu 20.04.3 LTS Base". With Ubuntu, the release number gives the date the version was released; so 20.04 is from April 2020. "LTS" means it's a long-term support version, but in fact there is a fresh LTS version out now, 22.04.

I'm just sticking with 20.04 for now in case of any software incompatibilities with the new version; we may end up doing an in-place upgrade to 22.04 later.

NOTE: Ubuntu is a distribution of Linux. You need a few things besides the Linux kernel to run a full Linux system, and various different full Linux operating systems are based around the kernel. Ubuntu is simply my current favourite, and you're welcome to use another if you follow along; however, if you're not already pretty experienced with Linux I do recommend sticking as close as possible to my specific choices.

What's next?

Feel like joining me on the road to witnessdom? Order yourself an AX51-NVMe, or an equivalent machine elsewhere, and join me next time as we start to set it up :)

Alternatively, if you have enough spare parts to assemble most of the machine yourself physically, and maybe just need to order a nice big disk and some extra RAM -- and if you have somewhere to put it where fans won't annoy you -- consider building a PC just for this purpose, and installing Ubuntu on it.

Next episode, we'll learn how to connect to our server using a terminal program.

Sort:  

Thank you for the detailed introduction. I'm curious about your further explanations and look forward to a step-by-step guide.

I will definitely follow it! 👍

A few days ago I came across this information. If I understand it correctly, Hetzner no longer allows Witness nodes.

Wow! That could certainly have repercussions. Will monitor this closely, thanks for the heads-up.

As soon as I read your comment, I was expecting this to be related to cloud VMs only, not dedicated boxes. In fact they mention only colocation as an exemption :/

This could leave quite a dent in the crypto hosting space.

Whichever provider I'm using, I always stay away from any provider-specific extensions (backup systems, etc) so that it's as easy as possible to migrate to a different host.

Everything I'm doing here in Zero to Witness should work exactly the same on an Ubuntu 20.04 host with another provider.

Might be time to look at a few more hosts...

Yes, I was not happy about this information either. A provider where it is allowed would be contabo.com, for example - as far as I know.

Here at least is written:

Cryptocurrencies utilizing proof of stake approach are welcome at Contabo.

A bit more expensive, as far as this configuration is sufficient.

I had a Contabo-VPS for about a year and also had contact with the support, not the fastest, but competent and always solved my requests.

Let's discuss over here :)

I hadn't heard of Contabo, thanks - will check them out

Contabo.com provide us cheap vps

Not so long ago I was looking for information on how to become a Steam Witness. But I didn't find anything in detail explanatory. After reading your article, and it is written in an accessible language, I realized which way to move! Thank you for such a detailed explanation.

I'm really hoping that someone with no detailed knowledge does use this guide. Answering their questions along the way is the only way I'll realise what I'm missing out! If you do decide to become a witness, please ping me with any queries about the series.

At first glance ....it seems to be a long text.., but coming a little bit closer i found out what i will call great gem.

This must be a very big system.....

The introduction or the orientation you provide here is top notch and it's great to learn about how witness set up thier workstation..., apart from the few witness i know, i have not actually seen thier workstation before.

The little explanation here is clear....

I'll like to follow up your next lesson.., unfortunately...i'll just be reading as i am not promising to have ..AX51-NVMe....., that's a lot of cash...

But i could use the lessons here for research....

Thank you :)

Yes, although it's affordable for me it's certainly still a significant expense. I hope that by the end of the series, even people who aren't very confident with the tech will be able to make a value judgement, and decide if it's worth investing in a server to become a witness.

There is also the opportunity to host your Witness Node at home, if for example you have spare hardware to build a machine, and somewhere to put it where it won't bother you with fan noise, etc!

That's actually a good idea. It's something i would really love if i have the means. I love tech ...,atleast 15 to 17 or even more hours of my day is working with tech...basically..., part of my life revolve around tech.

If i see opportunity to practice more of this...,i don't think i'll have a second thought...

Thanks for all the votes and support, I really appreciate it! Episode 2 coming within the next few hours :)

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.033
BTC 64106.00
ETH 3129.71
USDT 1.00
SBD 4.16