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

Function fetchBlocks

packages/node-core/src/api.service.ts:54–60  ·  view source on GitHub ↗
(heights: number[], numAttempts = MAX_RECONNECT_ATTEMPTS)

Source from the content-addressed store, hash-verified

52 private connectionRetrys: Record<string, Promise<void> | undefined> = {};
53
54 async fetchBlocks(heights: number[], numAttempts = MAX_RECONNECT_ATTEMPTS): Promise<B> {
55 return this.retryFetch(async () => {
56 // Get the latest fetch function from the provider
57 const apiInstance = this.connectionPoolService.api;
58 return apiInstance.fetchBlocks(heights);
59 }, numAttempts);
60 }
61
62 protected async retryFetch(fn: () => Promise<B>, numAttempts = MAX_RECONNECT_ATTEMPTS): Promise<B> {
63 try {

Callers

nothing calls this directly

Calls 1

fetchBlocksMethod · 0.65

Tested by

no test coverage detected