-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: test-env graphman passthrough + more
- Loading branch information
Showing
14 changed files
with
208 additions
and
48 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
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,19 @@ | ||
[store] | ||
[store.primary] | ||
connection = "postgresql://graph-node:let-me-in@postgres:5432/graph-node" | ||
pool_size = 10 | ||
|
||
[deployment] | ||
[[deployment.rule]] | ||
indexers = ["index_node_1"] | ||
|
||
[chains] | ||
ingestor = "index_0" | ||
[chains.mainnet] | ||
shard = "primary" | ||
provider = [ | ||
{ label = "mainnet-rpc-0", url = "http://anvil:8545", features = [ | ||
"archive", | ||
"traces", | ||
] }, | ||
] |
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,23 @@ | ||
/* eslint-disable */ | ||
const compose = require('docker-compose') | ||
const path = require('path') | ||
|
||
const rewindSubgraph = async ({ blockNumber, blockHash }) => { | ||
const dockerComposeFile = path.resolve(__dirname, './docker-compose.yml') | ||
const composeOpts = { | ||
log: true, | ||
composeOptions: ['-p', 'ens-test-env'], | ||
config: dockerComposeFile, | ||
} | ||
const items = await compose.ps({ ...composeOpts, log: false }) | ||
if (items.data.services.length === 0) { | ||
throw new Error('No services running') | ||
} | ||
await compose.exec( | ||
'graph-node', | ||
`graphman --config /opt/graph-node/config.toml rewind ${blockHash} ${blockNumber} graphprotocol/ens --force --sleep 1`, | ||
composeOpts, | ||
) | ||
} | ||
|
||
module.exports.rewindSubgraph = rewindSubgraph |
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,8 @@ | ||
/* eslint-disable */ | ||
export const rewindSubgraph = async ({ | ||
blockNumber, | ||
blockHash, | ||
}: { | ||
blockNumber: number | ||
blockHash: `0x${string}` | ||
}) => Promise<void> |
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,24 @@ | ||
/* eslint-disable */ | ||
import compose from 'docker-compose' | ||
import path from 'path' | ||
import { URL as URLClass } from 'url' | ||
|
||
const __dirname = new URLClass('.', import.meta.url).pathname | ||
|
||
export const rewindSubgraph = async ({ blockNumber, blockHash }) => { | ||
const dockerComposeFile = path.resolve(__dirname, './docker-compose.yml') | ||
const composeOpts = { | ||
log: true, | ||
composeOptions: ['-p', 'ens-test-env'], | ||
config: dockerComposeFile, | ||
} | ||
const items = await compose.ps({ ...composeOpts, log: false }) | ||
if (items.data.services.length === 0) { | ||
throw new Error('No services running') | ||
} | ||
await compose.exec( | ||
'graph-node', | ||
`graphman --config /opt/graph-node/config.toml rewind ${blockHash} ${blockNumber} graphprotocol/ens --force --sleep 1`, | ||
composeOpts, | ||
) | ||
} |
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
Oops, something went wrong.