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
+5
View File
@@ -129,6 +129,11 @@ export class GraphWatcher {
this.fillEventSignatureMap();
}
async switchClients ({ ethClient, ethProvider }: { ethClient: EthClient, ethProvider: providers.BaseProvider }) {
this._ethClient = ethClient;
this._ethProvider = ethProvider;
}
fillEventSignatureMap () {
this._dataSources.forEach(contract => {
if (contract.kind === 'ethereum/contract' && contract.mapping.kind === 'ethereum/events') {