MCPcopy Create free account
hub / github.com/subquery/subql / fetchBlocks

Method fetchBlocks

packages/node/src/indexer/api.service.ts:389–399  ·  view source on GitHub ↗
(
    heights: number[],
    overallSpecVer?: number,
    numAttempts = MAX_RECONNECT_ATTEMPTS,
  )

Source from the content-addressed store, hash-verified

387
388 // Overrides the super function because of the specVer
389 async fetchBlocks(
390 heights: number[],
391 overallSpecVer?: number,
392 numAttempts = MAX_RECONNECT_ATTEMPTS,
393 ): Promise<IBlock<LightBlockContent>[] | IBlock<BlockContent>[]> {
394 return this.retryFetch(async () => {
395 // Get the latest fetch function from the provider
396 const apiInstance = this.connectionPoolService.api;
397 return apiInstance.fetchBlocks(heights, overallSpecVer);
398 }, numAttempts);
399 }
400
401 // Polkadot uses genesis hash instead of chainId
402 protected assertChainId(

Callers

nothing calls this directly

Calls 1

fetchBlocksMethod · 0.65

Tested by

no test coverage detected