mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-11 18:24:05 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user