Skip to content

examples to handle RPC errors when sending requests to blockchain nodes.

Notifications You must be signed in to change notification settings

akegaviar/rpc-error-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RPC error handling examples

This repo contains multiple examples to handle RPC errors when sending requests to blockchain nodes.

Handle errors with Promises

Use can wrap the RPC requests in a method and use Promise.all, Promise.race or Promise.any.

Retry same request

We can wrap the RPC request in a method that catches any error and use recursion to make the retries.

Retry same request with delay

A modification of the previous one, just adding a delay between each retry

Retry with a backup provider

The retries are done using a different provider that users a different RPC endpoint.

Retry with backup provider for smart contract methods

Another wrapper function used to invoke smart contract methods, catch any errors and retry using a different provider and RPC endpoint.

About

examples to handle RPC errors when sending requests to blockchain nodes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published