One old laptop, seven blockchain nodes

Asynchronous Phil
4 min readApr 17, 2020
The 2011 Lenovo x220

I have been running a Kusama node on my old Lenovo x220 since the launch of the network last year. Before that, I unsuccessfully attempted to validate on a Polkadot network testnet using that laptop from my home internet connection, but that didn’t work out so well — I got slashed every time for high latency.

So instead of validating, I found another way to stress-test this old lovely machine by simultaneously running as many Substrate-based nodes as it could handle. This article talks about some of the highlights of my experiences running over seven nodes for the past month.

About the old laptop

The Lenovo x220 is perhaps one of the most beloved laptops of all time. With its clicky full-sized keyboard, replaceable and extendable battery, and rugged chassis, it’s become a standard of previous-generation laptops. I’ve made some alterations, including:

  • installing an IPS display to replace the horrible old “TN” display
  • swapping out the HDD for an SSD (necessary for any blockchain node)
  • upgrading the battery

The basic specifications for my model are as follows: an Intel Core i5–2520M (2.5–3.2 GHz, 3MB L3 Cache) processor, 4 GB DDR3–1600MHz RAM, and a 256GB Samsung SSD. It is running Arch Linux with Awesome WM for low memory usage, since I need all the megabytes of RAM I can get.

Compiling in Rust with Substrate

Substrate is the blockchain framework for building fully-customized and autonomously upgrading blockchains. It is written in the Rust programming language, which brands itself as fast, safe and concurrent (pick 3!). It gets a lot of praise for its strict bug-brute-forcing compiler, which could have prevented bugs seen in the Bitcoin core client. On the other hand, that same compiler is a reason for much of its criticism: it takes a very long time to compile.

On my modern 2018 machine with an i5 and 16GB of RAM, Polkadot takes about 20 minutes to compile from source. For my 2011 x220, it takes around 35–40 minutes. When compiling on my x220, the laptop can be heard from another room trying to cool itself down as all the CPU cores are maxed out. There are easier ways to install blockchains based on Substrate, such as Docker images and binaries, but since I’m a Linux* user I like to do things the hard way. All the nodes I’ve installed were compiled from source, many of which done while other nodes were running in the background.

Installed blockchain nodes

The following blockchain nodes have been running simultaneously on my laptop for the past month:

  • Kusama: the canary network for Polkadot (mainnet)
  • Edgeware: a self-upgrading smart contract network (mainnet)
  • Kulupu: a proof-of-work blockchain built on Substrate (mainnet)
  • Totem: shared accounting protocol for SMEs (testnet)
  • Westend: Polkadot staging environment (testnet)
  • Plasm: High-throughput scaling for Dapps (testnet)
  • Acala: DeFi chain for stablecoin on Polkadot (testnet)

Installing some nodes were more difficult than others, as some documentation was lacking on various repositories, but after a few attempts and some great community support from these teams, I was able to spin up each node.

Syncing was a breeze for some chains, and quite slow for others. I was most impressed with the Acala team’s speed optimizations using off-chain workers that allowed that old laptop to sync over 400 blocks per second! For Kusama, I was getting between 50 and 100 blocks per second using the `wasm-execution=Compiled` flag.

The good, the bad, and the ugly

Kusama metrics on Grafana via Prometheus

The good: I was surprised that seven nodes could run in such a stable state for so long on 4GB of RAM. The stability of Substrate is something to behold, as all nodes never crashed, hung up or disconnected once I established a connection. Even with all these nodes running and RAM 80% full, it felt like interacting via Polkadot.js with each node was faster than using a hosted third-party node.

The bad: However, some nodes would drop peers from time to time but quickly re-establish connections to each network. Certain blockchains have been built with older versions of Substrate which do not include the fast-syncing features that would have been really helpful to catch up to the head of the chain.

The ugly: when compiling or syncing other nodes, sometimes my laptop would hang for 30–40 minutes without accepting any input, or even worse, power would cut.

Going forward

Going through this taught me a lot about maintaining Substrate-based blockchain nodes. I plan on writing articles on how to monitor statistics using Prometheus and Grafana, interacting with each blockchain’s interface, and installing other networks such as Subsocial and Centrifuge chain.

Running many simultaneous nodes is a great way to be a Fisherman on Polkadot in the future, although I would probably use a faster machine for such an activity, since pruning will likely need to be turned off.

Please reach out to me via twitter @ph_lux if you have any questions or need help setting up your own node from scratch.

Special thanks to the Totem team and Edgeware community for their technical support.

*I purposefully avoid saying “Linux/GNU” to annoy Richard Stallman.

--

--