Deprecate postgraphile usage (#122)

* Deprecate postgraphile usage

* Change endpoint in watcher config

* Remove subscription queries from eth-client

* Remove postgraphile config and client from watchers

Co-authored-by: nabarun <nabarun@deepstacksoft.com>
This commit is contained in:
prathamesh0
2022-06-08 12:13:52 +05:30
committed by GitHub
co-authored by nabarun
parent e4b9596be7
commit 71d34331e9
90 changed files with 207 additions and 321 deletions
+6 -6
View File
@@ -28,7 +28,7 @@ interface DataSource {
export class GraphWatcher {
_database: Database;
_indexer?: IndexerInterface;
_postgraphileClient: EthClient;
_ethClient: EthClient;
_ethProvider: providers.BaseProvider;
_subgraphPath: string;
_wasmRestartBlocksInterval: number;
@@ -38,9 +38,9 @@ export class GraphWatcher {
_context: Context = {};
constructor (database: Database, postgraphileClient: EthClient, ethProvider: providers.BaseProvider, serverConfig: ServerConfig) {
constructor (database: Database, ethClient: EthClient, ethProvider: providers.BaseProvider, serverConfig: ServerConfig) {
this._database = database;
this._postgraphileClient = postgraphileClient;
this._ethClient = ethClient;
this._ethProvider = ethProvider;
this._subgraphPath = serverConfig.subgraphPath;
this._wasmRestartBlocksInterval = serverConfig.wasmRestartBlocksInterval;
@@ -124,7 +124,7 @@ export class GraphWatcher {
const { contract, event, eventSignature, block, tx: { hash: txHash }, eventIndex } = eventData;
if (!this._context.block) {
this._context.block = await getFullBlock(this._postgraphileClient, this._ethProvider, block.hash);
this._context.block = await getFullBlock(this._ethClient, this._ethProvider, block.hash);
}
const blockData = this._context.block;
@@ -184,7 +184,7 @@ export class GraphWatcher {
}
async handleBlock (blockHash: string) {
const blockData = await getFullBlock(this._postgraphileClient, this._ethProvider, blockHash);
const blockData = await getFullBlock(this._ethClient, this._ethProvider, blockHash);
this._context.block = blockData;
@@ -306,7 +306,7 @@ export class GraphWatcher {
return transaction;
}
transaction = await getFullTransaction(this._postgraphileClient, txHash);
transaction = await getFullTransaction(this._ethClient, txHash);
assert(transaction);
this._transactionsMap.set(txHash, transaction);
@@ -6,7 +6,7 @@ dataSources:
name: Example1
network: mainnet
source:
address: "0xD5567AFC3C6c1325698F27d97b74D9ea9c44295e"
address: "0x1ca7c995f8eF0A2989BbcE08D5B7Efe50A584aa1"
abi: Example1
startBlock: 10
mapping: