(2019-04-10) How To Build Your Own Blockchain Using Parity Substrate

How To Build Your Own Blockchain Using Parity Substrate. Parity Substrate is a blockchain development framework with many cool features like upgradable blockchains, modular architecture, customizable block execution logic, and hot-swappable consensus

This article is about how you can get started with the Substrate framework to build your own blockchain

The first step towards getting started with Substrate is setting up your development environment

Once the install script finishes execution, along with the dependencies, you will also have a couple of commands installed on your machine.

One of these commands is the substrate-node-new command which helps you set up a template node. Think of this as a project scaffolding template.

Building a Substrate Runtime Module

The business logic for the blockchain resides in the runtime modules. A collection of runtime modules constitutes a runtime.

As mentioned before, a Substrate runtime module packages together it’s own state and behavior. We would be creating a custom runtime module with the storage items and functions as mentioned above.

Firstly, let’s declare the storage items needed for the token functionality

Now that we have the storage defined for our Substrate module let’s write some code to manipulate these storage items.

Let’s now run the Substrate runtime we just created through the token transfer functions in the template.rs file.

Now that we have the Substrate node running with the token transfer runtime, let’s connect it with a UI to see it working.

The simplest way would be to use the Polkadot Apps Portal. It is a hosted web app primarily made for connecting to the Polkadot network nodes but it can also connect to a local Substrate node.


Edited:    |       |    Search Twitter for discussion