It is with great excitement that, today, the dfuse team unveils dfuse Search for Ethereum.
Until now, searching the Ethereum blockchain for the details of transactions (transfers and mutating function calls) and state (historical values of variables) has been slow and painful, taking up to minutes to complete even a simple search. Fast and reliable, let alone powerful and performant, blockchain search is a difficult technical problem and there are many technical challenges to be overcome:
- Native Ethereum nodes only include in their indexes the logs fields that were defined at the time a smart contract was deployed, imposing a trade off on usability vs cost;
- Querying multiple load-balanced Ethereum nodes requires developers to manage the uncertainties of eventually consistent data; and
- Making sense of the storage’s key/value pairs is often obfuscated by complex compiler techniques.
dfuse Search makes building a high performance application easy. It sifts through the entire blockchain history in under a second, finds exactly the transactions matching your query, and outputs the data you need within a single stream. This is all done while automatically handling disconnections and reconnections and eliminating false positives — never missing a beat! dfuse also handles and navigates forks so you don’t have to.
dfuse Search enables you to build world-class applications with a level of granularity that was not previously possible on blockchain, including:
- Highly performant and interactive user interfaces (lending platforms, wallets, DEX, games, etc.)
- Tracking real time trades on decentralized exchanges or of DeFi positions
- High precision dapp analytics
To access the Alpha release of dfuse Search on Ethereum:
- Sign up here and start building for free
- Connect to the Ethereum mainnet or Ropsten testnet endpoints
- Use our JS library
- Visit ethq.app to explore the Ethereum blockchain through the dfuse lense
The dfuse Search Query Language
The dfuse Search Query Language resembles the one exposed by Kibana or GitHub for sifting through issues. It is a simple, flat
key1:value1 key2:value2 string, yet allows negation clauses and combinations of
dfuse Search indexes each EVM call on the blockchain, as well as each Log, giving unprecedented granularity to your queries.
Querying EVM Calls
To return all transactions signed by a specific address, use:
To get all
calls to a given contract (as opposed to delegate calls, or callcodes), run:
To match transactions that provided a given input to a contract, use:
To match any transactions that invoked a given method on a contract:
To match any EVM call that tweaked storage for a given key in a contract:
You can also use
value to match the amount of value transferred from a call to another, use
from to find a specific transaction from a user, and then start mixing and matching.
When searching for logs, try the following queries:
Search by indexed topics or data directly:
or a combination of such things, to find transfers relevant to you:
Mix and match with
signer and a few other fields.
dfuse Handles All the Work of Navigating Forks
dfuse Search helps you navigate forks and resolve chain reorganizations, so you don’t need to handle that complexity on your end. Retrieve the chain-wide and fork-aware cursor, pass it back on the next query, and never miss a beat.
You can query by block range, in ascending or descending order. When querying ascending, you can use the built-in cursor to continue your search in the future, listening for new matches. See this article that shows a visual example.
dfuse’s Ethereum Alpha release
dfuse Search for Ethereum is currently in public alpha. This is our first public release, and as such we will be improving the API based on the feedback from our valued alpha users. Feel free to let us know what you’d like to see and how we can help to improve your development experience. Join the conversation in the dfuse Ethereum Telegram Channel and let’s build tomorrow’s next-generation dapps.