Indexer (EthSync tool) for Ethereum updated with Additional Indexes
0
0
Blockchain is at the core of a multitude of decentralized applications, but interacting with it directly can often be a cumbersome process. One of the most common operations that people want to perform is to query transactions involving a particular Ethereum address, similar to the functionality provided by Etherscan. While Ethereum nodes offer the RPC APIs for a myriad of functionalities, they lack the ability to easily get a transaction list by address.
To address this, we introduce a specialized Indexer written in Python. It goes beyond the built-in functionalities of common Ethereum nodes to allow for efficient querying of both ETH and ERC20 transactions by address. This article delves into the architecture of this Indexer, the newly added indexes, and how they drastically improve performance for more complex queries.
Core EthSync tool Features
Connectivity. The Indexer is designed to work as a background service, connecting to Ethereum nodes that provide HTTP, WS, or IPC API. It is compatible with popular nodes like Geth and Nethermind.
Data Storage. The collected transaction data is stored in a Postgres database, ensuring durability and quick access.
API Exposure. For client applications that wish to query transactions, the Indexer provides an API powered by PostgREST.
Additional Indexes introduced
One of the significant upgrades in this version is the inclusion of additional indexes. These are particularly beneficial for running more intricate queries like filtering Ethereum-only or specific token transactions for an address.
The new indexes drastically improve the performance, especially when you are dealing with complex queries that require specific filters.
For example, to get the last 25 USDT transactions for a specific address, you can use a cURL command as follows:
curl -k -X GET “https://localhost:3000/ethtxs?and=(txto.eq.0xdac17f958d2ee523a2206206994597c13d831ec7,or(txfrom.eq.0xabfDF505fFd5587D9E7707dFB47F45AF1f03E275,contract_to.eq.000000000000000000000000abfDF505fFd5587D9E7707dFB47F45AF1f03E275))&order=time.desc&limit=25"
In our tests, most queries perform in less than 100 ms, compared to tens of seconds without these indexes.
Conclusion
The new version of the Indexer offers a highly efficient way to obtain transaction history for any Ethereum address with the added benefit of additional indexes for more complex queries. It makes it easier than ever to navigate the Ethereum blockchain and access the data. Whether you are a developer or an end-user, this Indexer offers a robust solution to explore Ethereum transactions.
Links:
Indexer (EthSync tool) for Ethereum updated with Additional Indexes was originally published in ADAMANT on Medium, where people are continuing the conversation by highlighting and responding to this story.
0
0
Securely connect the portfolio you’re using to start.




