> For the complete documentation index, see [llms.txt](https://macha.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://macha.gitbook.io/docs/contracts-nodes-and-sdks/data-nodes.md).

# Data Nodes

Guide on how to use Macha Data Nodes

## Build Configuartion

## Run Macha Data Nodes

## Reading Configuration

## Streaming real-time txns

Macha's highly efficient system fetches real-time events with near 0% latency. This function listens to events triggered from the current timestamp of running the node.

A stream is initiated which periodically checks for new events. For every valid event caught, the loop is run to decode the associated data. This data arrives `RawData` which cannot be utilized directly. Hence, it must be deciphered and simplified to a usable form. The decoded data consists of - `method params`, `function name`, `transaction hash` and the `transaction receipt`.

To get the data of all previous transactions, head to the next section.

## Fetching historical txns

In this section, we go over how historical transactions are fetched. Crate `ethers` is used to create a client and fetch all previous transactions. The results can be restricted by `start_block` and `end_block` as the lower bound and upper bound respectively.

Once this data is received successfully, it is formatted and added to the database as shown above.

##

## Use of Handlers for&#x20;
