Skip to content

Commit

Permalink
service: Relax network subgraph validation during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Sep 1, 2023
1 parent af3877c commit a285b05
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
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

0 comments on commit a285b05

Please sign in to comment.