MCPcopy Index your code
hub / github.com/subquery/subql / prepareProject

Function prepareProject

packages/cli/src/controller/migrate/migrate-controller.ts:52–64  ·  view source on GitHub ↗
(chainInfo: ChainInfo, subqlDir: string)

Source from the content-addressed store, hash-verified

50
51// Pull a network starter, as base project. Then mapping, manifest, schema can be overridden, copy over abi files
52export async function prepareProject(chainInfo: ChainInfo, subqlDir: string): Promise<void> {
53 const exampleProjects = await fetchExampleProjects(
54 networkFamilyToTemplateNetwork(chainInfo.networkFamily),
55 chainInfo.chainId
56 );
57 const templateProject = exampleProjects.find((p) => p.name.includes('-starter'));
58 if (!templateProject) {
59 throw new Error(
60 `Could not find subquery template for network ${chainInfo.networkFamily} chain ${chainInfo.chainId}`
61 );
62 }
63 await cloneProjectTemplate(path.parse(subqlDir).dir, path.parse(subqlDir).name, templateProject);
64}
65
66export async function getChainIdByNetworkName(networkFamily: NETWORK_FAMILY, chainName: string): Promise<string> {
67 const graphFamily = networkFamily.toLowerCase() === 'ethereum' ? 'eip155' : networkFamily.toLowerCase();

Callers 2

migrateSubgraphAdapterFunction · 0.90

Calls 4

fetchExampleProjectsFunction · 0.90
cloneProjectTemplateFunction · 0.90
findMethod · 0.65

Tested by

no test coverage detected