question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide `useRPC` hook to allow dynamic change of RPC provider

See original GitHub issue

Bug or feature?

Feature

What issue is this feature related to?

Multiple DApps come embedded with their own RPC providers like Infura, Quiknode, or Alchemy for them to work. This is mostly to avoid the UX experience of having to connect to Metamask before they can show any information. However, as a result, the DApp developer has to foot the bill on the provider used, share its credentials in the UI, and make the decision on the provider used by the final user, sadly affecting the user’s privacy (i.e. most providers do IP tracking). Yes, there are public providers like LinkPool or other community-oriented projects like RYO Cloud, but usually, the user is not given any option to change these.

What’s the feature you would like?

A hook a la useRPC that would allow to configure the RPC endpoint used for the DApp and reload the state of the application upon update. As I’m unsure how these would affect other providers, I’m bringing this feature here rather than just doing it solo.

What alternatives you have considered?

This is already somehow possible with the custom hooks feature, but it would be nice to have it OOB as part of useDApp

Additional context

The current practice for frontends is to embed an RPC endpoint, whitelist the contract used, and hope no one will exhaust it via some eth_getBalance calls. This could be a good step in a better direction.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dmaretskyicommented, Apr 11, 2022

@0xjjpa with the latest version you can pass a provider instance (compatible with BaseProvider from ethers) to the readOnlyUrls instead of the URL. This should let you use custom provider types, and configure the refresh interval on them

1reaction
brunoalanocommented, Nov 17, 2021

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

RPC error troubleshooting guidance - Windows Client
Learn how to troubleshoot Remote Procedure Call (RPC) errors that occur during computer-to-computer communication.
Read more >
A Definitive Guide to the Remote Procedure Call (RPC) Filter
This command takes no parameters. These commands result in the creation of an RPC filter that blocks remote connections to the RPC endpoint ......
Read more >
RPC API | Metasploit Documentation - Docs @ Rapid7
The msgrpc plugin provides a MessagePack interface that spawns a listener on a defined port and allows you to issue remote commands so...
Read more >
Troubleshooting "RPC Server Unavailable" Errors | Dell US
Numerous integrated Windows components use RPC. RPC uses dynamic ports for communication between computers, but a static port (TCP port 135) ...
Read more >
The dynamic ports are constantly changing, How do set them ...
You either need to allow the entire high-ports range (49152-65535), ... All applications that use RPC dynamic port allocation use ports 5000 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found