Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update rpc module #1463

Draft
wants to merge 263 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
a6cf9fd
cleanup
kyscott18 Dec 18, 2024
fd0d4db
more strict role
kyscott18 Dec 18, 2024
43accc7
pglite simplification
kyscott18 Dec 18, 2024
f4c0ae2
cleanup
kyscott18 Dec 18, 2024
e751916
fix tests
kyscott18 Dec 18, 2024
8819324
set drizzle schema fn
kyscott18 Dec 18, 2024
dd1f335
fix test
kyscott18 Dec 18, 2024
3ba0407
granular build
kyscott18 Dec 18, 2024
4934069
vite import
kyscott18 Dec 19, 2024
959ff6d
cleanup dev server
kyscott18 Dec 19, 2024
7cb4b94
fix start script
kyscott18 Dec 19, 2024
3d25521
improve errors
kyscott18 Dec 19, 2024
c5aa43b
update docs
kyscott18 Dec 19, 2024
175fac6
migration guide
kyscott18 Dec 19, 2024
40c0b22
Merge branch 'v0.9' into kjs/api-functions
kyscott18 Dec 19, 2024
1bba539
Merge branch 'kjs/api-functions' into kjs/client-db
kyscott18 Dec 19, 2024
1b48f7f
update client
kyscott18 Dec 19, 2024
19f79c6
use client in e2e tests
kyscott18 Dec 19, 2024
e31c86c
fix browser compatibility
kyscott18 Dec 19, 2024
dd313f1
stricter db types
kyscott18 Dec 19, 2024
1d0d66b
more strict db types
kyscott18 Dec 19, 2024
596c58d
fix ci
kyscott18 Dec 19, 2024
8482f93
docs
kyscott18 Dec 20, 2024
af071f9
nits
kyscott18 Dec 20, 2024
e000be0
limit query complexity
kyscott18 Dec 20, 2024
2d20ff6
fix e2e tests
kyscott18 Dec 20, 2024
6ed05f8
nits
kyscott18 Dec 20, 2024
30ec128
nits
kyscott18 Dec 20, 2024
7d57a61
nits
kyscott18 Dec 20, 2024
ba2b131
prepare namespace
kyscott18 Dec 20, 2024
5e5c98a
Merge pull request #1353 from ponder-sh/kjs/db-role
kyscott18 Dec 20, 2024
05dcb21
Merge branch 'v0.9' into kjs/api-functions
kyscott18 Dec 20, 2024
edd15e1
Merge pull request #1351 from ponder-sh/kjs/api-functions
kyscott18 Dec 20, 2024
5d3bb1d
Merge branch 'v0.9' into kjs/client-db
kyscott18 Dec 20, 2024
12d0e72
Merge pull request #1352 from ponder-sh/kjs/client-db
kyscott18 Dec 20, 2024
a165228
links
kyscott18 Dec 20, 2024
8edde32
client package
kyscott18 Dec 20, 2024
7bb1091
chore: prerelease
typedarray Dec 20, 2024
aa84bf5
update mg
kyscott18 Dec 20, 2024
377b02d
Merge branch 'v0.9' of https://github.com/0xOlias/ponder into v0.9
kyscott18 Dec 20, 2024
6ae709a
processing filter arrays in build added
khaidarkairbek Dec 23, 2024
a150566
filters build: args required, filters array, singular event
khaidarkairbek Dec 28, 2024
be7a78d
Merge branch 'main' into contracts-filter
khaidarkairbek Dec 29, 2024
dfc0564
tests fixed
khaidarkairbek Dec 29, 2024
8ff2f01
remove schema from cli options
kyscott18 Dec 31, 2024
14611db
minor refactoring
khaidarkairbek Dec 31, 2024
767bed9
refactor types location
kyscott18 Dec 31, 2024
c027cd3
internal directoryq
kyscott18 Jan 1, 2025
6e6d23c
database wrap
kyscott18 Jan 1, 2025
9f18b3a
cleanup
kyscott18 Jan 1, 2025
d4d2dad
source network
kyscott18 Jan 1, 2025
0edeef2
cleanup
kyscott18 Jan 1, 2025
ad4a41a
Merge branch 'v0.9' into contracts-filter
kyscott18 Jan 2, 2025
81019f5
remove filter from event names
kyscott18 Jan 2, 2025
5fc94bb
materialized status table
kyscott18 Jan 3, 2025
8cefecd
status export
kyscott18 Jan 3, 2025
dcada7d
fix shutdown behavior
kyscott18 Jan 3, 2025
499f140
start live queries
kyscott18 Jan 4, 2025
26c849a
escape database role
kyscott18 Jan 4, 2025
76d677a
fix
kyscott18 Jan 4, 2025
82d65b8
jsdoc
kyscott18 Jan 4, 2025
bb4ec2d
add status to client
kyscott18 Jan 4, 2025
88658f6
cleanup
kyscott18 Jan 4, 2025
ea51dd6
update types
kyscott18 Jan 5, 2025
0c35b0c
docs
kyscott18 Jan 5, 2025
1adf84d
Merge pull request #1373 from khaidarkairbek/contracts-filter
khaidarkairbek Jan 5, 2025
41c8a55
docs
kyscott18 Jan 5, 2025
379b7bb
Merge branch 'main' into v0.9
kyscott18 Jan 5, 2025
353d1e9
Merge branch 'main' into v0.9
kyscott18 Jan 5, 2025
77b2570
fix database cleanup and module argument types
kyscott18 Jan 5, 2025
f6b21bc
Merge branch 'v0.9' into kjs/internal
kyscott18 Jan 5, 2025
d7cdc74
fix merge
kyscott18 Jan 5, 2025
57a33ab
Merge pull request #1392 from ponder-sh/kjs/internal
kyscott18 Jan 5, 2025
222c635
Merge branch 'v0.9' into kjs/status
kyscott18 Jan 6, 2025
5dcd312
remove status from core
kyscott18 Jan 6, 2025
701dd0b
fix bad merge
kyscott18 Jan 6, 2025
8e257de
Merge pull request #1391 from ponder-sh/kjs/status
kyscott18 Jan 6, 2025
d7e0dd5
fix client example
kyscott18 Jan 6, 2025
56244e5
Merge branch 'v0.9' into kjs/live
kyscott18 Jan 6, 2025
84e2f4a
create chain type
kyscott18 Jan 7, 2025
2c09bd6
chains config
kyscott18 Jan 7, 2025
e0adcc3
create rpc module
kyscott18 Jan 7, 2025
bd591bc
use notifications on status table for live queries
kyscott18 Jan 8, 2025
2a7b8b7
live query
kyscott18 Jan 9, 2025
8a1175d
fix test
kyscott18 Jan 9, 2025
cd7544c
update run test
kyscott18 Jan 9, 2025
fddfbaf
realtime websocket
kyscott18 Jan 9, 2025
9a99deb
live query examples
kyscott18 Jan 9, 2025
214a12a
ping
kyscott18 Jan 9, 2025
3a075b1
cleanup
kyscott18 Jan 9, 2025
9001a85
docs
kyscott18 Jan 9, 2025
af25a96
batch query status
kyscott18 Jan 9, 2025
909d575
docs
kyscott18 Jan 9, 2025
0809696
update docs
kyscott18 Jan 9, 2025
dfe5c50
fix serve
kyscott18 Jan 9, 2025
30d6527
Merge branch 'main' into v0.9
kyscott18 Jan 9, 2025
9db4d1b
Merge branch 'v0.9' into kjs/live
kyscott18 Jan 9, 2025
2a55731
fix merge
kyscott18 Jan 9, 2025
f6ef3a6
remove driver from database type
kyscott18 Jan 9, 2025
b8d21e6
inject clients into api file
kyscott18 Jan 9, 2025
43cb1cd
chore: prerelease
typedarray Jan 9, 2025
bcf696d
wip docs
typedarray Jan 10, 2025
c94ae19
fix dev server
kyscott18 Jan 10, 2025
f6b7938
Merge branch 'kjs/live' of https://github.com/0xOlias/ponder into kjs…
kyscott18 Jan 10, 2025
260f7fa
fix plugin
kyscott18 Jan 10, 2025
e3c4372
`@ponder/react` (#1428)
kyscott18 Jan 10, 2025
3ee8edb
prerelease
typedarray Jan 10, 2025
1576aa8
offchain tables example
kyscott18 Jan 10, 2025
02c6bef
tsup config
kyscott18 Jan 10, 2025
3d0062a
pnpm dedupe
kyscott18 Jan 10, 2025
aff0233
implement rpc
kyscott18 Jan 12, 2025
7c15a61
fix docs link
kyscott18 Jan 13, 2025
1913fac
Merge pull request #1429 from ponder-sh/kjs/api-client
kyscott18 Jan 13, 2025
097ae94
merge
kyscott18 Jan 13, 2025
d1c8651
cleanup
kyscott18 Jan 13, 2025
f79b1f8
export queryKey helper function
kyscott18 Jan 13, 2025
633cf48
.
kyscott18 Jan 13, 2025
ff0b188
public client docs
kyscott18 Jan 13, 2025
e6570e7
add client to examples
kyscott18 Jan 13, 2025
a0b1d04
Merge pull request #1431 from ponder-sh/kjs/offchain
kyscott18 Jan 13, 2025
2fb7c64
Merge branch 'main' into v0.9
kyscott18 Jan 13, 2025
b832c25
Merge branch 'v0.9' of https://github.com/0xOlias/ponder into v0.9
kyscott18 Jan 14, 2025
a963eaf
Merge branch 'v0.9' into kjs/live
kyscott18 Jan 14, 2025
549e395
Merge branch 'main' into v0.9
kyscott18 Jan 14, 2025
ad6afa5
Merge branch 'v0.9' into kjs/live
kyscott18 Jan 14, 2025
64e6637
initial commit
kyscott18 Jan 14, 2025
fa673b8
note
kyscott18 Jan 14, 2025
6d25d46
cleanup
kyscott18 Jan 14, 2025
1cfb77d
Merge branch 'main' into v0.9
kyscott18 Jan 14, 2025
2160a45
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 14, 2025
b467ad7
multichain
kyscott18 Jan 14, 2025
06bac0a
metrics
kyscott18 Jan 14, 2025
ea21048
use globalThis
typedarray Jan 15, 2025
34bcc9c
algorithm utils
kyscott18 Jan 15, 2025
bf9f5a3
cleanup
kyscott18 Jan 15, 2025
b6461f0
add mode to config
kyscott18 Jan 15, 2025
c923797
app router
typedarray Jan 15, 2025
65df14f
finalize checkpoint and generator tests
kyscott18 Jan 15, 2025
94bc19a
multichain for single network
kyscott18 Jan 15, 2025
77e5882
fix types
kyscott18 Jan 15, 2025
a04ee74
more tests
kyscott18 Jan 16, 2025
5b3f044
fix: packaging, RSC (#1445)
typedarray Jan 16, 2025
4be754f
prerelease
typedarray Jan 16, 2025
594fd28
start realtime testing
kyscott18 Jan 16, 2025
afb71a1
more sync testing
kyscott18 Jan 16, 2025
a62400c
update client and react libraries, fix status
kyscott18 Jan 16, 2025
5e60594
update example app
kyscott18 Jan 16, 2025
ba649ab
fix lint
kyscott18 Jan 16, 2025
bee9441
add temp file limti
kyscott18 Jan 17, 2025
cf82775
docs cleanup
kyscott18 Jan 17, 2025
829a277
Merge branch 'main' into v0.9
kyscott18 Jan 17, 2025
01fce86
Merge branch 'v0.9' into kjs/live
kyscott18 Jan 17, 2025
411c899
fix type error
kyscott18 Jan 17, 2025
c8e412a
Merge pull request #1408 from ponder-sh/kjs/live
kyscott18 Jan 17, 2025
f6ce6eb
chore: changeset
kyscott18 Jan 17, 2025
da9266f
fix graphql status
kyscott18 Jan 17, 2025
65d8cec
fix schema escaping
kyscott18 Jan 17, 2025
ff98f93
dont drop role if already exists, make sure database name exists
jaylmiller Jan 17, 2025
ee5e6d4
fix omnichain latency timer
kyscott18 Jan 17, 2025
2a2673b
comments
kyscott18 Jan 17, 2025
8cff706
prerelease
typedarray Jan 18, 2025
080a5bd
only set temp_file_limit if current user has superuser
jaylmiller Jan 18, 2025
3e613d0
run ddl/permissions code in transaction
jaylmiller Jan 18, 2025
8e32ec9
Merge pull request #1450 from ponder-sh/jay/v09-role-fix
jaylmiller Jan 18, 2025
2681802
relax hono check
typedarray Jan 18, 2025
8d68bf1
prerelease
typedarray Jan 18, 2025
732d83e
check for recursive query in client
kyscott18 Jan 20, 2025
9e524df
new app type
kyscott18 Jan 20, 2025
25caa4a
Merge branch 'main' into v0.9
typedarray Jan 20, 2025
f705c14
cleanup
kyscott18 Jan 20, 2025
7218045
cleanup
kyscott18 Jan 21, 2025
34c32a6
fix: schema dropped after role created
typedarray Jan 21, 2025
3ef2ced
prerelease
typedarray Jan 21, 2025
7955b9e
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 21, 2025
c5826f8
fix type error
kyscott18 Jan 21, 2025
e0e2522
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 21, 2025
7ec22b2
fix status bug
kyscott18 Jan 21, 2025
5c0242e
remove role
kyscott18 Jan 22, 2025
f5705ea
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 22, 2025
c64d385
fix build constraint
kyscott18 Jan 22, 2025
d80d71a
fix postgres schema
kyscott18 Jan 22, 2025
61c2951
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 22, 2025
bede0a1
client security
kyscott18 Jan 22, 2025
e4aa401
fix database
kyscott18 Jan 23, 2025
1b3a7f5
merge main
typedarray Jan 23, 2025
50693a2
start cmd
typedarray Jan 23, 2025
6362025
prerelease
typedarray Jan 23, 2025
71de3d7
exports ilike, notlike
typedarray Jan 23, 2025
bbb763d
Merge branch 'v0.9' into rpc2
kyscott18 Jan 24, 2025
3e0cda2
fix test type error
kyscott18 Jan 24, 2025
be031b2
start validation
kyscott18 Jan 25, 2025
fef73cd
handle websocket connection error
khaidarkairbek Jan 25, 2025
f4d8edf
validate
kyscott18 Jan 25, 2025
525253f
Merge pull request #1464 from ponder-sh/kjs/query-validation
kyscott18 Jan 27, 2025
6c60571
cleanup client
kyscott18 Jan 27, 2025
1f7af76
cleanup
kyscott18 Jan 27, 2025
5f315af
pg client settings
kyscott18 Jan 27, 2025
fcaf227
update docs
kyscott18 Jan 27, 2025
d6d5993
no subscribe when not enabled
kyscott18 Jan 27, 2025
1d3bcd7
fix dynamic import
kyscott18 Jan 27, 2025
b3bdc20
fix api functions imports
kyscott18 Jan 27, 2025
e23689e
fix validation
kyscott18 Jan 27, 2025
e7c542e
Merge branch 'main' into v0.9
kyscott18 Jan 27, 2025
3a5042f
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 27, 2025
0bd2b13
merge multichain
kyscott18 Jan 28, 2025
20ab2d1
fix test type error
kyscott18 Jan 28, 2025
8bbbf95
remove console.log
kyscott18 Jan 28, 2025
bb5ac0e
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 28, 2025
2249d5d
nits
kyscott18 Jan 28, 2025
659b0fd
comment
kyscott18 Jan 28, 2025
db76b1d
update docs
kyscott18 Jan 28, 2025
85cfe0f
refactor seconds metrics
kyscott18 Jan 28, 2025
26d8696
cleanup
kyscott18 Jan 28, 2025
5af59fb
Merge branch 'v0.9' into kjs/multichain
kyscott18 Jan 28, 2025
d52a454
historical sync logs
kyscott18 Jan 28, 2025
bb64601
event extract logs
kyscott18 Jan 28, 2025
735bd81
fix extract logs
kyscott18 Jan 28, 2025
dcf47b5
realtime event logs
kyscott18 Jan 29, 2025
2c2fa78
nits
kyscott18 Jan 29, 2025
7ed0f2a
fix test
kyscott18 Jan 29, 2025
f64c297
fix test
kyscott18 Jan 29, 2025
8bda8d1
cleanup
kyscott18 Jan 29, 2025
2621c38
schema name not supported
kyscott18 Jan 29, 2025
799560f
validate system tables
kyscott18 Jan 29, 2025
21d1a94
docs
typedarray Jan 29, 2025
3b0fe9c
prerelease and eventsource fixes
typedarray Jan 29, 2025
76ada96
more logs
kyscott18 Jan 29, 2025
9d2210e
cleanup
kyscott18 Jan 29, 2025
6c5bc4d
fix eventsource and react deps
typedarray Jan 29, 2025
1cd26b4
fix test type error
kyscott18 Jan 29, 2025
d0944b2
react rerender fix
typedarray Jan 29, 2025
540627f
client example
typedarray Jan 29, 2025
b259124
fix tests
typedarray Jan 29, 2025
14579f6
rm prerelease
typedarray Jan 29, 2025
7b2780e
revert config update
kyscott18 Jan 29, 2025
36700e2
fix build
kyscott18 Jan 30, 2025
5eb4182
fix queries with bigint params
typedarray Jan 30, 2025
0888541
multichain reorg handling
kyscott18 Jan 30, 2025
79091fa
fix progress bar unit
kyscott18 Jan 31, 2025
40b6ce3
fix multichain reorg bug
kyscott18 Feb 2, 2025
82e02c0
more verbose logs
kyscott18 Feb 2, 2025
c18a405
cleanup
kyscott18 Feb 3, 2025
112ea79
updated realtime sync logs
kyscott18 Feb 3, 2025
313b1a6
update historical sync log
kyscott18 Feb 3, 2025
b4f4364
update default limit and ordering
kyscott18 Feb 3, 2025
6ed37f3
Merge branch 'v0.9' into kjs/multichain
kyscott18 Feb 3, 2025
9bdaf0b
Merge branch 'main' into kjs/multichain
kyscott18 Feb 3, 2025
75c6f34
Merge branch 'v0.9' into rpc2
kyscott18 Feb 4, 2025
6f40a85
rpc trace logs (#1394)
kyscott18 Jan 4, 2025
417c46e
Merge branch 'kjs/multichain' into rpc2
kyscott18 Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/unlucky-avocados-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ponder": patch
---

Added trace level logs for rpc requests.
8 changes: 8 additions & 0 deletions .changeset/warm-cats-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"create-ponder": minor
"@ponder/client": minor
"@ponder/react": minor
"ponder": minor
---

Released `0.9`. Visit the [migration guide](https://ponder.sh/docs/migration-guide) for details.
21 changes: 13 additions & 8 deletions examples/feature-multichain/ponder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,28 @@ export default createConfig({
networks: {
mainnet: {
chainId: 1,
transport: http(process.env.PONDER_RPC_URL_1),
pollingInterval: 15_000,
rpcUrl: [process.env.PONDER_RPC_URL_1!, process.env.PONDER_RPC_URL_1_WS!],
},
base: {
chainId: 8453,
transport: http(process.env.PONDER_RPC_URL_8453),
pollingInterval: 15_000,
rpcUrl: [
process.env.PONDER_RPC_URL_8453!,
process.env.PONDER_RPC_URL_8453_WS!,
],
},
optimism: {
chainId: 10,
transport: http(process.env.PONDER_RPC_URL_10),
pollingInterval: 15_000,
rpcUrl: [
process.env.PONDER_RPC_URL_10!,
process.env.PONDER_RPC_URL_10_WS!,
],
},
polygon: {
chainId: 137,
transport: http(process.env.PONDER_RPC_URL_137),
pollingInterval: 15_000,
rpcUrl: [
process.env.PONDER_RPC_URL_137!,
process.env.PONDER_RPC_URL_137_WS!,
],
},
},
contracts: {
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/_test/e2e/erc20/erc20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ test(
amount: parseEther("1"),
sender: ALICE,
});

await waitForIndexedBlock({
port,
networkName: "mainnet",
block: { number: 2 },
});

const result = await client.db.select().from(schema.account);

expect(result[0]).toMatchObject({
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/_test/e2e/erc20/ponder.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { http } from "viem";
import { createConfig } from "../../../config/index.js";
import { erc20ABI } from "../../generated.js";

Expand All @@ -20,7 +19,7 @@ export default createConfig({
networks: {
mainnet: {
chainId: 1,
transport: http(`http://127.0.0.1:8545/${poolId}`),
rpcUrl: `http://127.0.0.1:8545/${poolId}`,
},
},
contracts: {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/_test/e2e/factory/ponder.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { factory } from "@/config/address.js";
import { http, getAbiItem } from "viem";
import { getAbiItem } from "viem";
import { createConfig } from "../../../config/index.js";
import { factoryABI, pairABI } from "../../generated.js";

Expand All @@ -21,7 +21,7 @@ export default createConfig({
networks: {
mainnet: {
chainId: 1,
transport: http(`http://127.0.0.1:8545/${poolId}`),
rpcUrl: `http://127.0.0.1:8545/${poolId}`,
},
},
contracts: {
Expand Down
16 changes: 7 additions & 9 deletions packages/core/src/_test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type AddressInfo, createServer } from "node:net";
import { factory } from "@/config/address.js";
import { createConfig } from "@/config/index.js";
import type { Network, Status } from "@/internal/types.js";
import type { Address, Chain } from "viem";
import type { Chain, Status } from "@/internal/types.js";
import type { Address, Chain as ViemChain } from "viem";
import { http, createPublicClient, createTestClient, getAbiItem } from "viem";
import { mainnet } from "viem/chains";
import { erc20ABI, factoryABI, pairABI } from "./generated.js";
Expand All @@ -26,7 +26,7 @@ export const anvil = {
webSocket: [`ws://127.0.0.1:8545/${poolId}`],
},
},
} as const satisfies Chain;
} as const satisfies ViemChain;

export const testClient = createTestClient({
chain: anvil,
Expand Down Expand Up @@ -56,8 +56,8 @@ export const getErc20ConfigAndIndexingFunctions = (params: {
},
contracts: {
Erc20: {
abi: erc20ABI,
network: "mainnet",
abi: erc20ABI,
address: params.address,
includeCallTraces: params.includeCallTraces,
includeTransactionReceipts: params.includeTransactionReceipts,
Expand Down Expand Up @@ -171,19 +171,17 @@ export const getAccountsConfigAndIndexingFunctions = (params: {
return { config, rawIndexingFunctions };
};

export const getNetwork = (params?: {
export const getChain = (params?: {
finalityBlockCount?: number;
}) => {
return {
name: "mainnet",
chainId: 1,
chain: anvil,
transport: http(`http://127.0.0.1:8545/${poolId}`)({ chain: anvil }),
rpcUrl: `http://127.0.0.1:8545/${poolId}`,
maxRequestsPerSecond: 50,
pollingInterval: 1_000,
finalityBlockCount: params?.finalityBlockCount ?? 1,
disableCache: false,
} satisfies Network;
} satisfies Chain;
};

export function getFreePort(): Promise<number> {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/bin/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export async function dev({ cliOptions }: { cliOptions: CliOptions }) {
indexingCleanupReloadable = await run({
common,
database,
preBuild,
schemaBuild,
indexingBuild: indexingBuildResult.result,
onFatalError: () => {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/bin/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export async function start({ cliOptions }: { cliOptions: CliOptions }) {
cleanupReloadable = await run({
common,
database,
preBuild,
schemaBuild,
indexingBuild: indexingBuildResult.result,
onFatalError: () => {
Expand Down
22 changes: 15 additions & 7 deletions packages/core/src/bin/utils/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "@/_test/setup.js";
import { deployErc20 } from "@/_test/simulate.js";
import { getErc20ConfigAndIndexingFunctions } from "@/_test/utils.js";
import { getNetwork } from "@/_test/utils.js";
import { getChain } from "@/_test/utils.js";
import { buildConfigAndIndexingFunctions } from "@/build/configAndIndexingFunctions.js";
import { buildSchema } from "@/build/schema.js";
import { createDatabase } from "@/database/index.js";
Expand All @@ -29,7 +29,7 @@ const account = onchainTable("account", (p) => ({
const schema = { account };

test("run() setup", async (context) => {
const network = getNetwork();
const chain = getChain();

const { address } = await deployErc20({ sender: ALICE });

Expand Down Expand Up @@ -57,7 +57,7 @@ test("run() setup", async (context) => {

const indexingBuild: IndexingBuild = {
buildId: "buildId",
networks: [network],
chains: [chain],
sources,
indexingFunctions,
};
Expand All @@ -78,9 +78,13 @@ test("run() setup", async (context) => {

const kill = await run({
common: context.common,
database,
preBuild: {
databaseConfig: context.databaseConfig,
mode: "multichain",
},
schemaBuild,
indexingBuild,
database,
onFatalError: vi.fn(),
onReloadableError: vi.fn(),
});
Expand All @@ -93,7 +97,7 @@ test("run() setup", async (context) => {
});

test("run() setup error", async (context) => {
const network = getNetwork();
const chain = getChain();

const { address } = await deployErc20({ sender: ALICE });

Expand Down Expand Up @@ -122,7 +126,7 @@ test("run() setup error", async (context) => {

const indexingBuild: IndexingBuild = {
buildId: "buildId",
networks: [network],
chains: [chain],
sources,
indexingFunctions,
};
Expand All @@ -145,9 +149,13 @@ test("run() setup error", async (context) => {

const kill = await run({
common: context.common,
database,
preBuild: {
databaseConfig: context.databaseConfig,
mode: "multichain",
},
schemaBuild,
indexingBuild,
database,
onFatalError: vi.fn(),
onReloadableError: () => {
onReloadableErrorPromiseResolver.resolve();
Expand Down
Loading
Loading