Career, Tech Knowledge, Web3

Web 3.0 development with Substrate. Part 1: Setting the environment.

This post is part of a series on Web 3.0 Development with Substrate.

Substrate is a framework for developing blockchain-based automated protocols within a modular environment. However, as cutting-edge as this might sound, Substrate doesn’t operate out of the box or in isolation. On the contrary, existing mark-up, programming and machine languages have been put to contribution for the release of Substrate. Let’s examine the Substrate environment from a web 2.0 developer’s perspective.

Languages

Substrate is written in the programming language Rust. If you don’t know what Rust might look or feel like, think of Firefox and DropBox. These are robust software with a focus on strong performance and efficiency. Since 2018, Rust itself has evolved to integrate more programming tools. The ecosystem taps into CLI, npm, networks, servers and devices. This makes Rust ideal for working on existing and upcoming IT infrastructures such as Cloud computing, Big Data, Blockchain and IoT.

From Rust to Web 3.0
From Rust to Wasm to Web 3.0.

Substrate is built for Web Assembly (Wasm) compilation and execution. Wasm is a platform-agnostic programming format that allows client-side and server-side applications to run seamlessly across the web. Wasm is all about leveraging the hardware capabilities of local environments to run a variety of machine instructions and computer programmes. Wasm supports a versionless and therefore backward-compatible web that is ideal for blockchain runtimes; thus leaving infinite scope for development.

Operating Systems

Installing Rust for Substrate development is the fastest on MacOs and Linux as you only need to enter a couple of commands in the Terminal. Afterwards, the Rust Nightly and Wasm toolchain can also be set up via the Terminal to manage the compilation process. This will work flawlessly provided that up-to-date versions are used alongside Substrate. To access UI functionalities, NodeJS and Yarn will also need to be installed on your computer.

Substrate combines Rust and Wasm in a single environment.
Substrate combines Rust and Wasm for blockchain development. [Courtesy of Parity Technologies]

For Windows users, however, setting up the environment involves a couple more steps. Visual Studio Build tools, Rust, LLVM, OpenSSL and cmake are applications that need to be installed individually. Though the margin for error is more important, this setup can be completed within an hour if you stick to a manual installation of binary files instead of using executables.

As we have seen, setting up your Substrate environment is not very different from what web developers go through with frameworks like VueJS, Laravel or Dotnet. Substrate’s novelty lies in how it elegantly reuses familiar technologies to provide a bank of back-end components for building custom blockchains. We will look at this in Part 2.

References:

Rust: A language empowering everyone to build reliable and efficient software

Web Assembly: Overview

Substrate Knowledgebase: Installation