Author: Ayush Mishra

Create runtime API of Substrate based 2D barcode scanner Pallet for Querying

Reading Time: 2 minutes In my previous post Integrate Substrate based 2D barcode scanner Pallet in your Substrate Runtime, I explained how to integrate Substrate pallet in your runtime.  Substrate runtime is its State Transition Function, which contains business logic of a Blockchain that determines how the state changes when a block is processed and defines its behaviour of the Blockchain. Substrate runtime can be accessed to outer node though an API, Continue Reading

Integrate Substrate based 2D barcode scanner Pallet in your Substrate Runtime

Reading Time: 2 minutes In my previous post Substrate based 2D barcode scanner Pallet in Rust, I explained how to create Substrate pallet easily. A pallet, Also known as Runtime modules, contains the logic, which can modify the features and functionality of your blockchain’s state-transition function. A typical Substrate project consists of 4 components: NodeRuntimePalletsExecute in Docker The runtime is Substrate’s state transition function and is divided into separate Continue Reading

Substrate based 2D barcode scanner Pallet in Rust

Reading Time: 2 minutes As we know, Rust is one of the best programming languages for blockchain due to its highly-capable mechanism of handling mutable states. The fast, memory safe, and exclusively concurrent nature of this blockchain coding language makes it most suitable for developing real-world blockchains. I was looking for a Rust based blockchain framework and I found Substrate, which is developed by Parity technology and built in Continue Reading

Linux System Call `fork()` in Rust

Reading Time: 2 minutes As we know, System calls provide an interface to the services that are available by the operating system. It is a mechanism in which a computer program requests a service from the kernel of the OS. In this blog, I will cover fork() system call. fork() is used to create a new process by duplicating the calling process. The new process is referred to as Continue Reading

Prevent Breaking Code Changes in Future Releases using `non exhaustive` enums in Rust

Reading Time: 2 minutes Hello everyone, recently I have come across a feature in Rust, known as non_exhaustive. It was introduced in Rust 1.40.0 . This attribute prevents source code-breaking changes in projects downstream. enums can be non-exhaustive or exhaustive, depending upon their needs. A non-exhaustive enum indicates that this enum may get new value in the future. By adding #[non_exhaustive] attribute, we can create a non-exhaustive enum which Continue Reading

Rust with WebAssembly: Simple explanation with a nice example

Reading Time: 2 minutes Now a days everyone is talking about WebAssembly. In this blog, I will explain how you can get started with Rust and WebAssembly fast with a simple template. But before we start, lets discuss what is webassembly, why Rust should be preferred for it. What is WebAssembly: We can think of webassembly as a type of bytecode that can be generated from any language. That Continue Reading

Custom Implementation of Blockchain In Rust(Part 3)

Reading Time: 2 minutes In previous blogs(part-1 and part-2), we created a sample blockchain application. We also implemented validation and proof of work algorithm. Now we are going to upgrade our blockchain to simple cryptocurrency. We can do this by:- Including the functionality of paying out rewards to miners Signing the transaction We will be covering only first part in this blog. We will cover transaction signature in next Continue Reading

Custom Implementation of Blockchain In Rust(Part 2)

Reading Time: 2 minutes Hello Everyone, in the previous blog, we talked about blockchain, what is block and its content. we also implemented a sample Blockchain application using Rust.In this blog, we will continue working with our sample blockchain application and talk about blockchain validation and its mining process. Blockchain Validation Why do we need blockchain validation? Because we have to ensure that no one can tamper any data Continue Reading

Trace caller’s source location in the stable Rust

Reading Time: < 1 minute Hello folks, In this blog, I will be introducing a feature to track source location of caller of a function.In one of the Rust projects, I came across a scenario, where I had to trace source location of caller of a function. Rust also has this feature, but it is not available for stable release. So I published a crate trace_caller and introduced trace , Continue Reading

Custom Implementation of Blockchain In Rust(Part 1)

Reading Time: 3 minutes Hello folks, in this blog, we will be learning how to create our own Blockchain, which is a technology behind Bitcoin. Blockchain technology has been called the greatest innovation since the internet. A Blockchain is a chain of blocks which contain information. A block contains the following:-1) Transaction Data:- This contains information about the Sender, Receiver, number of bitcoins to be transferred. 2) PreviousHash:- Hash Continue Reading

Loggers in Rust

Different ways to write unit test-cases in Rust

Reading Time: 2 minutes As a developer, we know that how important is to write unit test-cases in programming life. Unit Tests allows you to make big changes to code quickly. The main goal of unit testing is to segregate each part of the program and test that the individual parts are working correctly. Failure in a unit test shows without a doubt which part of the code doesn’t Continue Reading

Debugging with and without parameter in Rust

Reading Time: < 1 minute Rust 1.32.0 introduced a macro dbg! for quick and dirty debugging with which you can inspect the value of a given expression. In one of my previous blogs Are you still using println in Rust for debugging? I explained about this macro in detail. Rust 1.35.0 announced an improvement in this macro to make it more usable for Rustaceans. Now you can trace any fine Continue Reading

Why programming community should be serious about RUST

Reading Time: 3 minutes I have been exploring Rust from the last few weeks, as it has been declared the most loving language in 2018. As a Scala/Java developer, I worked on many applications, which were related to the banking domain, web applications, mobile applications, e-commerce, social media, etc. But I was not able to find what kind of applications should be built in Rust? I have searched Rust’s Continue Reading