Skip to content

Commit

Permalink
add fallback for web3 json-rpc...
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagden committed Dec 18, 2024
1 parent 0bd6024 commit a7c807b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ function enrichConfig(conf: ServiceConfiguration) : ServiceConfiguration {
...conf,
}

// if the EthereumEndpoint is a pointing to the Matic network, do not do the fallback enrichment.

if (enriched.EthereumEndpoint[0].includes('matic') || conf.EthereumEndpoint[0].includes('polygon')) {
console.log ('Matic network detected, not adding a fallback endpoint.');
return enriched;
}

const ethEndPoint = [enriched.EthereumEndpoint[0], 'https://rpcman-fastly.orbs.network/rpc?chain=ethereum&appId=guardian&key=888798GHWJ759843GFDSJK759843'];
enriched.EthereumEndpoint = ethEndPoint;

Expand Down

0 comments on commit a7c807b

Please sign in to comment.