mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-02-03 00:32:49 +00:00
2417e3feb1
* Fix minor linting errors * Fix CLI getters linting errors * Fix resolvers template in codegen * Fix dependencies
43 lines
1.0 KiB
Handlebars
43 lines
1.0 KiB
Handlebars
//
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
//
|
|
|
|
import 'reflect-metadata';
|
|
import debug from 'debug';
|
|
|
|
import { InspectCIDCmd } from '@cerc-io/cli';
|
|
{{#if (subgraphPath)}}
|
|
import { getGraphDbAndWatcher } from '@cerc-io/graph-node';
|
|
{{/if}}
|
|
|
|
import { Database{{#if (subgraphPath)}}, ENTITY_QUERY_TYPE_MAP, ENTITY_TO_LATEST_ENTITY_MAP{{/if}} } from '../database';
|
|
import { Indexer } from '../indexer';
|
|
|
|
const log = debug('vulcanize:inspect-cid');
|
|
|
|
const main = async (): Promise<void> => {
|
|
const inspectCIDCmd = new InspectCIDCmd();
|
|
await inspectCIDCmd.init(Database);
|
|
|
|
{{#if (subgraphPath)}}
|
|
const { graphWatcher } = await getGraphDbAndWatcher(
|
|
inspectCIDCmd.config.server,
|
|
inspectCIDCmd.clients.ethClient,
|
|
inspectCIDCmd.ethProvider,
|
|
inspectCIDCmd.database.baseDatabase,
|
|
ENTITY_QUERY_TYPE_MAP,
|
|
ENTITY_TO_LATEST_ENTITY_MAP
|
|
);
|
|
|
|
{{/if}}
|
|
await inspectCIDCmd.initIndexer(Indexer{{#if (subgraphPath)}}, graphWatcher{{/if}});
|
|
|
|
await inspectCIDCmd.exec();
|
|
};
|
|
|
|
main().catch(err => {
|
|
log(err);
|
|
}).finally(() => {
|
|
process.exit(0);
|
|
});
|