How to access data from Blockchains πŸ‘¨πŸ»β€πŸ’»

Jun 10, 2021 2 min read
How to access data from Blockchains πŸ‘¨πŸ»β€πŸ’»
Ongoing guide. If you have suggestions/comments, or want to write about it leave a note below.

Why we need it?

Let's say you want to build an app and you want to fetch data from the blockchain, how do you read/write it? Let's talk about that.

Overview

You can access blockchain data like the way you access normal data in any Β MVC where you fetch data from database ,manipulate it in backend and display the result in front end. In case of blockchain,what all you need to understand is it is Β nothing but a decentralized database where transactions occur dynamically and the data is distributed among all the nodes.

So to explain how the data is actually fetched from blockchain, what I do is Crawl each block in the blockchain and store the data in your preferred data base like MySql or Mongo.

Objective

Use 1 API to access all Blockchains, not only 1, that is also decentralized.

Different Approaches

As I see it there are two ways of doing this, the ground up focusing on infrastructure or using a service and focusing on the product only. Here are them:

  1. From Ground up:
    If you want to query the balance use a json-rpc req through an ETH full node.
    You can do that on any blockchain through whatever nodes or requests they support. You just need access to a full node.

    For notifications on balance changes just use web sockets instead.
  2. Services:
    There are already services that provide this kind of data and they continue to innovate, the advantage of this is that if the startup company is small 1-10 employees, the development can be way faster and secure by using services such as Covalenthq to use as API to retrieve data from blockchain. There are other useful services such as parsiq to turn blockchain data into actions, cryptocurrencyalerting to get crypto alerts, Β epns for Ethereum Push Notifications and thegraph as API interact with the Etherium blockchain.

How-To

There are different purposes for accessing data, in this case I want to access it for development purposes, read here how data can be read using Covalenthq.

If you are planning to track crypto using excel sheets, you could use something like Cryptosheets.

Other more advanced methods involve creating creating RPC-JSON calls with Websockets/webhooks, but this one is a full implementation and require deep understanding.

Great! Next, complete checkout for full access to ArturoFM.
Welcome back! You've successfully signed in.
You've successfully subscribed to ArturoFM.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.