-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cached transport supports all methods * add more actions to context.client * fix: required block parameters for some methods * start new filter impl * debug rpc types * withLog * add debug helper functions * syncTrace in sync-historical added with filter matching * syncTrace filtering modified, blockwise processing added * sync-realtime: added tx/transfer factories * sync: fragments and encoding for transaction/transfer filters * sync-realtime: transaction/trasfer filter added * sync-realtime: handleBlock is modified for new filters * sync-realtime: fetchBlockEventData changed to debug and new filters for traces * update historical sync * build checkpoint for traces * record failed traces * implement insert traces db method * . * cleanup realtime * corrections: minor changes * sync-historical: traceCache added * sync-realtime: trace traversal added in fetchBlockEventData and handleBlock * sync: buildEvents and decodeEvents modfied * fix debug type * merge all interval tables into one * fix typo * filter/filterinterval migration into intervals * sync-store: fragment_id modified * fix fragment tests * stricter fragment id types * multi range * disable cache skips interval table * cleanup * batched getIntervals * fix: insert empty intervals * cleanup * migrations * order request * new rpc request table * notes * new filter types * decodeEvents + buildEvents * fix: range_agg * fix: range merging * fix: nits * more adjacent filters * rpc request migrations * required block actions * docs * fix * snake case * chore: changeset * preserve arrays * fix: ordering object arrays * chore: changeset * remove down migration * fix tests * fix: migration bug * fix: parse rpc response from cache * sync-historical: transaction filter * getEvents * account sources * accounts config * sync-realtime: fetchBlockEventData and handleBlock modified to handle account filters * cleanup realtime logs * minor fix * build accounts * start historical sync tests * update sync tests * sync: handle factory address * cleanup * fix transport tests * realtime sync tests * fix typecheck * account specific test * accounts example * fix virtual types * cleanup sync * note * transaction includeReverted * cleanup * back * factory fn * fix * filter * fix: config * sync: factory filter * sync: factory filter cont. * include * build * set * feature-accounts * cleanup * fix type * nits * nits * fragments * sync and events * update docs * update examples * update docs * cleanup * internal * trace type * nits * nits * remove transactionReceipt.logs * fix type error * fix * cleanup * fix config * fix query * normalize event * fix interval migrations * @/generated * fix accounts example * fix normalization * cleanup * fix * try fix actions * try fix actions * start migration guide * fix transaction event type * update mg * fix type test * use request hash to avoid large index * cleanup migration guide * fix migrations rounding * cleanup mg * config reference * cleanup * fix transfer txr type * update indexing functions docs * skip migrating checkpoint in trace migration * fix changeset ignore * docs * call traces * database schema manual deployments (#1312) * start deploy docs * more docs * cli * . * start new database service * test * dev * fix e2e * update direct sql * cli * fix schema bug * meta migration * explicit pre-build * database parameters * merge results * log * start list * db list * docs * improve error messages * cleanup * db list * cleanup list * dev fast path * accounts docs * remove as of * database docs mostly done * dev drop tables * direct sql * migration * fix: migrations compatible with postgres 14 * docs * error message tweaks --------- Co-authored-by: typedarray <[email protected]> * migration guide * changeset --------- Co-authored-by: Work <[email protected]> Co-authored-by: typedarray <[email protected]> Co-authored-by: Kevin <[email protected]>
- Loading branch information
1 parent
2f12876
commit 37ed2e1
Showing
260 changed files
with
12,768 additions
and
9,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,10 @@ | |
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": ["@changesets/changelog-github", { "repo": "ponder-sh/ponder" }], | ||
"commit": false, | ||
"fixed": [["@ponder/core", "create-ponder", "eslint-config-ponder"]], | ||
"fixed": [["ponder", "create-ponder", "eslint-config-ponder"]], | ||
"ignore": [ | ||
"@ponder/common", | ||
"ponder-examples-feature-accounts", | ||
"ponder-examples-feature-blocks", | ||
"ponder-examples-feature-factory", | ||
"ponder-examples-feature-filter", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"ponder": minor | ||
--- | ||
|
||
Released `0.8`. Visit the [migration guide](https://ponder.sh/docs/migration-guide) for a full list of changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ponder/core": patch | ||
--- | ||
|
||
Added support for caching all available rpc methods. Several new client actions are available, including `context.client.simulateCall()`, `context.client.getTransactionCount()`, `context.client.getTransactionReceipt()`, and `context.client.getBlockTransactionCount()`. See [docs](https://ponder.sh/docs/indexing/read-contract-data#supported-actions) for all actions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
title: "Accounts" | ||
description: "Learn how to index accounts in a Ponder app" | ||
--- | ||
|
||
import { Callout, Steps } from "nextra/components"; | ||
|
||
# Accounts | ||
|
||
Account indexing is useful for activity that is not associated with a specific contract, like transactions and native transfers to and from an address. The key difference between `contracts` and `accounts` in `ponder.config.ts` is that accounts do not have an ABI. | ||
|
||
<Callout type="info"> | ||
The standard Ethereum RPC does not support filtering for transactions & native | ||
transfers. So, account indexing uses a block-by-block approach which is often | ||
slower than log indexing. | ||
</Callout> | ||
|
||
## Quick example | ||
|
||
In this example, we'll index transactions sent by the [Beaver](https://beaverbuild.org/) block builder account. | ||
|
||
<Steps> | ||
|
||
### Add an account | ||
|
||
Add the network, address, and start block to the `accounts` field in `ponder.config.ts`. | ||
|
||
```ts filename="ponder.config.ts" | ||
import { createConfig } from "ponder"; | ||
|
||
export default createConfig({ | ||
// ... more config | ||
accounts: { | ||
BeaverBuild: { | ||
network: "mainnet", | ||
address: "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5", | ||
startBlock: 20000000, | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
### Register indexing functions | ||
|
||
Register an indexing function for the `transaction:from` event. The framework will fetch all transactions where `transaction.from` matches the account address, then process each one using your indexing function. | ||
|
||
```ts filename="src/index.ts" {4} | ||
import { ponder } from "ponder:registry"; | ||
import { transactions } from "ponder:schema"; | ||
|
||
ponder.on("BeaverBuilder:transaction:from", async ({ event, context }) => { | ||
await context.db.insert(transactions).values({ | ||
from: event.transaction.from, | ||
to: event.transaction.to, | ||
value: event.transaction.value, | ||
gasUsed: event.transactionReceipt.gasUsed, | ||
// ... more fields | ||
}); | ||
}); | ||
``` | ||
|
||
Account indexing also supports the `transaction:to`, `transfer:from`, and `transfer:to` events. [Read more](/docs/api-reference/config#accounts) about event types. | ||
|
||
</Steps> | ||
|
||
## Account name | ||
|
||
Every account must have a unique name, provided as a key to the `accounts` object. Names must be unique across accounts, contracts, and block intervals. | ||
|
||
```ts filename="ponder.config.ts" {9} | ||
import { createConfig } from "ponder"; | ||
import { http } from "viem"; | ||
|
||
export default createConfig({ | ||
networks: { | ||
mainnet: { chainId: 1, transport: http(process.env.PONDER_RPC_URL_1) }, | ||
}, | ||
accounts: { | ||
BeaverBuilder: { | ||
network: "mainnet", | ||
address: "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5", | ||
startBlock: 12439123, | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
## Network | ||
|
||
The `network` option for accounts works the same way as it does for contracts. [Read more](/docs/contracts-and-networks#network). | ||
|
||
## Address | ||
|
||
The `address` option for accounts works the same way as it does for contracts. You can provide a single address, a list of addresses, or an address factory. You can also specify network-specific overrides. [Read more](/docs/contracts-and-networks#address). | ||
|
||
## Block range | ||
|
||
The `startBlock` and `endBlock` options for accounts work the same way as it does for contracts. [Read more](/docs/contracts-and-networks#block-range). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.