From eab1b88bee0f3f3759c0d930c3bd6f4bb2efd4ed Mon Sep 17 00:00:00 2001 From: Nabarun Date: Thu, 19 Oct 2023 14:24:41 +0530 Subject: [PATCH] Add example GQL queries made in Ponder indexers --- .../stacks/fixturenet-payments/ponder-demo.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/app/data/stacks/fixturenet-payments/ponder-demo.md b/app/data/stacks/fixturenet-payments/ponder-demo.md index c915883b..adfac3e3 100644 --- a/app/data/stacks/fixturenet-payments/ponder-demo.md +++ b/app/data/stacks/fixturenet-payments/ponder-demo.md @@ -110,6 +110,56 @@ Stack components: # ... ``` +* Following are the example GQL queries (with payment headers) `ponder-indexer-2` makes to `ponder-indexer-1` for fetching data + + ```graphql + { + getEthLogs( + chainId: 1212, + address: "0x6325439389e0797ab35752b4f43a14c004f22a9c", + fromBlock: 100, + toBlock: 200, + ) { + address + blockHash + blockNumber + data + logIndex + removed + topics + transactionHash + transactionIndex + } + + getEthBlock( + chainId: 1212, + blockNumber: 150, + fullTransactions: false + ) { + baseFeePerGas + difficulty + extraData + gasLimit + gasUsed + hash + logsBloom + miner + mixHash + nonce + number + parentHash + receiptsRoot + sha3Uncles + size + stateRoot + timestamp + totalDifficulty + transactionsRoot + txHashes + } + } + ``` + * In another terminal run the Ponder app in watcher mode: ```bash @@ -139,6 +189,41 @@ Stack components: # 08:02:37.849 DEBUG payment Verified payment for GQL queries getLogEvents ``` +* Following are the example GQL queries (with payment headers) `ponder-watcher` makes to `ponder-indexer-2` for fetching data + + ```graphql + getLogEvents( + fromTimestamp: 1695303079, + toTimestamp: 1695304156, + filters: [ + { + name: "SmolBrain" + chainId: 42161, + address: ["0x6325439389e0797ab35752b4f43a14c004f22a9c"], + fromBlock: 100, + toBlock: 200, + includeEventSelectors: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] + } + ] + ) { + events { + transaction { + hash + } + log { + id + } + block { + number + } + } + metadata { + pageEndsAtTimestamp + isLastPage + } + } + ``` + * Open watcher Ponder app endpoint http://localhost:42069 * Try GQL query to see transfer events