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

Function getStartHeight

packages/node-core/src/utils/project.ts:296–303  ·  view source on GitHub ↗
(dataSources: BaseDataSource[])

Source from the content-addressed store, hash-verified

294}
295
296export function getStartHeight(dataSources: BaseDataSource[]): number {
297 const startBlocksList = dataSources.map((item) => item.startBlock || 1);
298 if (startBlocksList.length === 0) {
299 throw new Error(`Failed to find a valid datasource, Please check your endpoint if specName filter is used.`);
300 } else {
301 return Math.min(...startBlocksList);
302 }
303}

Callers 2

createMethod · 0.90

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected