Implement failover for RPC endpoints in watcher (#506)

* Handle RPC endpoint server errors and switch failover endpoints

* Add config maxNewBlockRetries for switching to failover endpoint

* Upgrade package versions

* Move unknown events removal after event processing for historical sync

* Rename doFailOverEndpoints to switchClients
This commit is contained in:
2024-05-09 16:03:06 +05:30
committed by GitHub
parent 6d837dc824
commit c9696c3d9f
25 changed files with 195 additions and 62 deletions
@@ -2,6 +2,7 @@
import assert from 'assert';
import { DeepPartial, FindConditions, FindManyOptions } from 'typeorm';
import { providers } from 'ethers';
import {
IndexerInterface,
@@ -338,4 +339,8 @@ export class Indexer implements IndexerInterface {
async getFullTransactions (txHashList: string[]): Promise<EthFullTransaction[]> {
return [];
}
switchClients ({ ethClient, ethProvider }: { ethClient: EthClient, ethProvider: providers.BaseProvider }): void {
return undefined;
}
}