github-actions
released this
13 Jan 03:06
·
1161 commits
to main
since this release
Patch Changes
-
#57
3f358dd
Thanks @0xOlias! - BREAKING! Updated ponder config to support typescript and to be calledponder.ts
by default.ponder.ts
must export a variable namedconfig
that is of the typeimport { PonderConfig } from "@ponder/core"
. Thedatabase
field in ponder config is now optional. By default, it usesSQLite
with a filename of./.ponder/cache.db
. If the environment variableDATABASE_URL
is detected, it usesPostgres
with that value as theconnectionString
.New sample
ponder.ts
file:// ponder.ts import type { PonderConfig } from "@ponder/core"; import { graphqlPlugin } from "@ponder/graphql"; export const config: PonderConfig = { networks: [ { name: "mainnet", chainId: 1, rpcUrl: process.env.PONDER_RPC_URL_1, }, ], sources: [ { name: "ArtGobblers", network: "mainnet", abi: "./abis/ArtGobblers.json", address: "0x60bb1e2aa1c9acafb4d34f71585d7e959f387769", startBlock: 15863321, }, ], plugins: [graphqlPlugin()], };
The exported value can also be a function, and it can return a Promise:
// ponder.ts import type { PonderConfig } from "@ponder/core"; export const config: PonderConfig = async () => { return { networks: [ /* ... */ ], sources: [ /* ... */ ], }; };