Skip to content

Commit

Permalink
agent: simplify startup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Jun 30, 2023
1 parent 13f30eb commit 1c006ad
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions packages/indexer-agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,16 @@ export class Agent {

// --------------------------------------------------------------------------------
// * Ensure there is a 'global' indexing rule
// --------------------------------------------------------------------------------
await this.multiNetworks.map(({ operator }) =>
operator.ensureGlobalIndexingRule(),
)

// --------------------------------------------------------------------------------
// * Ensure NetworkSubgraph is indexing
// --------------------------------------------------------------------------------
await this.multiNetworks.map(async ({ network }) =>
this.ensureNetworkSubgraphIsIndexing(network),
)

// --------------------------------------------------------------------------------
// * Register the Indexer in the Network
// --------------------------------------------------------------------------------
await this.multiNetworks.map(({ network }) => network.register())
await this.multiNetworks.map(
async ({ network, operator }: NetworkAndOperator) => {
operator.ensureGlobalIndexingRule()
this.ensureNetworkSubgraphIsIndexing(network)
network.register()
},
)

this.buildEventualTree()
return this
Expand Down

0 comments on commit 1c006ad

Please sign in to comment.