EOSIO

Available on:

  • EOS Mainnet
  • CryptoKylin Testnet
  • Jungle 2.0 Testnet
  • Your own network
Coming Soon

dfuse’s GraphQL Endpoints Now Serve ABI-Decoded Database Operations

Jul 4, 2019 2:09:09 PM / by dfuse

When pulling data from the blockchain, most of the information returned is stored in binary format so as to save space and allow for quicker transmission of data. This makes it difficult to sift through, as it first needs to be decoded into a readable format (ex: JSON). dfuse has recently expanded its GraphQL endpoints to include ABI-decoded table rows inside dfuse Search results.

Before today’s announcement, multiple REST calls were required to achieve the results below, leading to synchronization and latency issues. Now GraphQL turns it into a single query, with a tailored payload, through a real-time stream (in a GraphQL Subscription).

dfuse Tracks Deep Database Operations

Let’s take the example of an EOS token transfer. Say Alice has 10 EOS and Bob has 5. If Alice transfers 1 EOS to Bob, then the eosio.token contract will need to update both rows: one for Alice and one for Bob’s accounts.

alice bob 5 eos

View of database operations on eosq.app

These are known as database operations. dfuse is the only one that provides these state deltas down to the the action-level. This level of granularity allows you to track down any issues in your contracts, as you can see the side effects of each action's execution, even if your transaction has 25 actions.

Stock nodeos provides a view of the last state (content of tables for the different contracts), and it is always moving. You can think of this in terms of other history providers giving you just a recap of the information, whereas dfuse provides each detail.

This new feature ensures you get an ABI-decoded JSON view of the table rows, and takes into account any changes to the on-chain ABI. Querying historical transactions always uses the relevant historical ABI.

Some contracts provide an invalid ABI, one inconsistent with its transactions or no ABI at all. In these cases, you will find the error field useful, and the object field will return null.

Announcing a Unified View of Transactions And State Changes Through the dfuse GraphQL Endpoints

Let’s consider the query to view vote pay (eosio.vpay) actions for the account eoscanadacom:

"receiver:eosio.token action:transfer data.from:eosio.vpay data.to:eoscanadacom":

Vote pay query no dbOps

In the above view (and with all other history solutions), you only receive the quantity being transferred (274.9777 EOS). However, if we add in:

dbOps queryYou will now receive:

Vote pay query with dbOps-1

Those dbOps for both eosio.vpay and eoscanadacom are nowhere to be found with other history solutions.

With dfuse, you can now have a precise view of your balance after each action (or of any table) committed after any action. This is a non-negligible advantage for accounting purposes!

So if you’re after the full story and not just a recap, dfuse is the only platform that should be feeding your dapp with information.

Join the discussion in the dfuse API Telegram channel. Get started for free and learn why many dapp developers are now feeding their backend with information from dfuse.

topics EOSIO, dfuse Search, Release, GraphQL, ABI Decoder