Photo by Adi Goldstein on Unsplash
Photo by Adi Goldstein on Unsplash
Photo by Adi Goldstein on Unsplash

Everyone who has ever heard about Go has also heard about goroutines, we are going to cover all you need to know about executing, utilizing and managing goroutines without breaking your neck. Concurrency is the beauty of Go, in fact, this is what makes Go special. If you master this, you reach the soul of the language and enlightenment would strike you. We are going to cover Goroutines, Channels, WaitGroup and Mutex, this is pretty much all that is required to build amazing concurrent software.

How to make the most of this article

This article will give you a concise explanation and a step by step tutorial of almost every building block in Go’s concurrency model, however, covering everything in detail is not possible over here. So if you feel you need to understand something in detail, just Google the respective headers of each section and you will find a lot of depth. You can bookmark this article and keep it as a reference which you can come back to. …


Building a Redis sorted set copier in Go

Learning by doing is the best way to pick up any new technology. This tutorial will provide a quick start for you, this means that we will not be getting into the details regarding the syntax, installation, set up, etc. and instead focus on the important elements while building a real and useful app. There are a lot of tutorials already available for helping you set up everything, understand the syntax, etc, so links are provided to external resources wherever possible.

Why build a Command-Line App in Go

  • Compiles to a single static binary: With Go, you can easily provide a single static binary that contains your whole application or CLI for your chosen platform. To target a different CPU or OS, you can just pass in an environmental override while building the application. …


Image for post
Image for post

Databases (or DBs) have played a very important part in the recent evolution of computers. At the time, computers were basically giant calculators and data (names, phone numbers) was considered the leftovers of processing information. Computers were just starting to become commercially available, and when business people started using them for real-world purposes, this leftover data suddenly became important.

In this article, we would go through the process of understanding the problem and deriving the corresponding solution in Go.

Image for post
Image for post

In a key value database, all access to the database is done using a primary key. Typically, there is no fixed schema or data model. The key can be identified by using a random lump of data. Key-value stores “are not” useful when there are complex relationships between data elements or when data needs to be queried by other than the primary key. …


Image for post
Image for post

Sharding is a very old concept in centralised database design. A database shard is a horizontal partition of data in a database. Each individual partition is referred to as a shard or database shard. Each shard is held on a separate database server instance, to spread load. It means breaking up your database into multiple separate databases which do not share any common data. It allows horizontal scaling of any database system as we can increase the shards to to scale infinately.

UPDATE : Karachain has been shut down, as has always been communicated, we were anyways not going for any fundraising round in the near future, which still stands in place.


Image for post
Image for post

This time, we are going through the most used Peer to Peer protocols which could be used in blockchain or any kind of distributed systems, all of which we have used in our journey till now.

UPDATE : Karachain has been shut down, as has always been communicated, we were anyways not going for any fundraising round in the near future, which still stands in place.

What is a DHT

Hashing is a technique that is used to uniquely identify a specific object from a group of similar objects. A distributed hash table (DHT) is a class of decentralised distributed system that has (key, value) pairs and any participating node can efficiently retrieve the value associated with a given key. This is similar to the working of a hash table that forms a data structure that implements an associative array abstract data type. Nodes have the responsibility to manage the mapping from keys to values in a way that creates minimal disruption in the case of change of participants. …


This began when we were on a lookout to find the differences and the similarities between the widely-popular used-by-Bitcoin consensus mechanism — Proof of Work, and an alteration to the Proof of Stake consensus mechanism called the ‘Delegated’ Proof of Stake. Before delving into analogies, let’s get our hands dirty with some introduction to both.

UPDATE : Karachain has been shut down, as has always been communicated, we were anyways not going for any fundraising round in the near future, which still stands in place.

What Proof of Work is, in a nutshell

Bitcoin uses a consensus mechanism in which miners need to apply heavy computing resources (also physical components such as electricity, cooling systems, significant land area etc.) to validate the transactions in a block. The use of resources proves to be vital in attacks against the network because any malicious miner would need to possess more resources than 51% of the miners in a group, which is practically not very possible, while also considering the theory that maximum people in a group have good intentions. …


Image for post
Image for post

Before focussing on the title, let us first see what a Proof of Stake consensus mechanism in a blockchain means. Proof of Stake is when a miner is able to mine or validate transactions in a block based on their current holding of the particular altcoin. So, the more percentage of the altcoin you hold, the more is your mining power. This is contrary to the Proof of Work consensus mechanism used by Bitcoin where the mining power is proportional to the computing power that a miner holds.

UPDATE : Karachain has been shut down, as has always been communicated, we were anyways not going for any fundraising round in the near future, which still stands in place.


Image for post
Image for post

GoLang has become a go-to language for developing decentralised systems today. Every other organisation is using it for their core processing modules, it has also gained a lot of traction in web development.

We evaluated multiple languages like C, C++, Java, and even NodeJs when we decided to build Karachain. We also tried benchmarking some algorithms to decide the core language for the implementation of Karachain protocol. Today, I am pleased to announce that we are using Go for this very purpose.

Building a blockchain right now is equivalent to building an Operating System way back in time.

UPDATE : Karachain has been shut down, as has always been communicated, we were anyways not going for any fundraising round in the near future, which still stands in place.


Lets convert one of the most common paper contracts into an Ethereum based Smart Contract. I will show you the code as well as tell you about the technology stack required to implement the complete solution in a step by step process.

Contract Definition

It is a contract between a landlord and tenant. The purpose of the contract is to make sure that rent is paid on time. Here is how the contract functions:

  1. The landlord initiates the contract by setting up the monthly rent and his house address and then the state of the contract is set to “Created”.
  2. Tenant signs the contract and the tenure begins and the state of the contract is set to “Started”.When the state is “Started” the agreement can not be confirmed again, thus eliminating the possibility of overwriting the current tenant. …


Image for post
Image for post

Essentially, a Blockchain is a database that can be used to store anything. It is different from most of today’s databases and offers better and more secure ways of storing information.

Now, we all store our data somewhere — the photos we click and the messages we send are stored in our phones, the movies we download are stored on our computer and so on. In the case of most modern databases, the control lies with a central administrator, who gives permissions to users to read, write, edit and delete data onto the database. Now, why do we blindly trust this central authority? What is to stop this central authority from making changes to our saved data? …

About

Syed Jafar Naqvi

Golang/Java/Node.Js

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store