Implement reset job queue and state CLI in watchers (#276)

* Implement clean jobs CLI in watchers

* Pull common code cleanJobs to util

* Implement commands for reset job-queue and state

* Reset command for job-queues and watcher state

* Reset sync status on reset state

* Fix using cli from built js

* Implement skipCheck to reset syncStatus table and skip complete handler on fail

* Check for block isComplete on reset state

* Set default value for force param to update syncStatus to false

* Reset tables in erc20 watcher

* Push job in fill after previos block is complete
This commit is contained in:
2021-10-20 16:06:03 +05:30
committed by GitHub
parent f00ea0c1f0
commit 47b9e6bbbd
47 changed files with 703 additions and 130 deletions
@@ -72,6 +72,10 @@ export class EthClient {
);
}
async getBlocksByNumber (blockNumber: number): Promise<any> {
return this._graphqlClient.query(ethQueries.getBlocksByNumber, { blockNumber });
}
async getBlockByHash (blockHash: string): Promise<any> {
return this._graphqlClient.query(ethQueries.getBlockByHash, { blockHash });
}
@@ -64,6 +64,20 @@ query allEthHeaderCids($blockNumber: BigInt, $blockHash: String) {
}
`;
export const getBlocksByNumber = gql`
query allEthHeaderCids($blockNumber: BigInt) {
allEthHeaderCids(condition: { blockNumber: $blockNumber }) {
nodes {
cid
blockNumber
blockHash
parentHash
timestamp
}
}
}
`;
export const getBlockByHash = gql`
query block($blockHash: Bytes32) {
block(hash: $blockHash) {
@@ -113,6 +127,7 @@ export default {
getStorageAt,
getLogs,
getBlockWithTransactions,
getBlocksByNumber,
getBlockByHash,
subscribeBlocks,
subscribeTransactions