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

Relax network subgraph validation in Indexer Service startup #759

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions packages/indexer-agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,8 @@ export class Agent {
)
}

// TODO: This could be a initialization check inside Network.create() once/if the Indexer Service
// uses Network instances.
async ensureNetworkSubgraphIsIndexing(network: Network) {
if (
network.specification.subgraphs.networkSubgraph.deployment !== undefined
Expand Down
2 changes: 2 additions & 0 deletions packages/indexer-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Relax network subgraph validation during indexer-service startup

## [0.20.21] - 2023-08-24
### Changed
Expand Down
18 changes: 12 additions & 6 deletions packages/indexer-service/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,18 @@ export default {
// If the network subgraph deployment is present, validate if the `chainId` we get from our
// provider is consistent.
if (argv.networkSubgraphDeployment) {
await validateProviderNetworkIdentifier(
protocolNetwork,
argv.networkSubgraphDeployment,
graphNode,
logger,
)
try {
await validateProviderNetworkIdentifier(
protocolNetwork,
argv.networkSubgraphDeployment,
graphNode,
logger,
)
} catch (e) {
logger.warn(
'Failed to validate Network Subgraph on index-nodes. Will use external subgraph endpoint instead',
)
}
}

logger.info('Connect to contracts', {
Expand Down
Loading