JsonRpcProvider only works with localhost
See original GitHub issueHi, I dunno if I’m using this right or not but I’m having a lot of issues experimenting with the different providers. Example: JsonRpcProvider:
case "R" : break;
provider = new ethers.providers.JsonRpcProvider("http://164.68.121.219:8545");
break;
case "L" :
// THIS WORKS AND RETURNS CORRECT BALANCE VALUES !!!
provider = new ethers.providers.JsonRpcProvider("http://localhost:8545");
break;
I tried to connetc to a local geth node and to a remote geth node. The connection with the local node works and I can read the balances of some addresses and block number and they are right, but if I try to connect to a remote machine it does not even try to connect. It is not a netowrking issue, I got this cleared. If I start a tcpdump on the address it does not even generate outgoing packets from the machine the browser is running. Could it be the browser or something concerning CORS or similar? TIA
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
JsonRpcProvider - ethers
The JSON-RPC API is a popular method for interacting with Ethereum and is available in all major Ethereum node implementations (e.g. Geth and...
Read more >What is http://localhost:8545? - json rpc
http://localhost:8545 is the RPC port of your locally running Ethereum node ... JsonRpcProvider("http://127.0.0.1:8545") And it worked.
Read more >How to connect to custom Provider using ethers?
JsonRpcProvider (); // To connect to a custom URL: let url = "http://something-else.com:8546"; let customHttpProvider = new ethers.providers.
Read more >How to use the ethers.providers function in ethers - Snyk
if (!provider) { try { // Allow read-only access to the blockchain if no ... JsonRpcProvider('http://localhost:8545') : new ethers.
Read more >How to connect to Ethereum network with ethers.js - QuickNode
1. When someone thinks of developing a dApp the first tool that comes to their mind is web3.js which is ... 2. First,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
… briliant… I’m an idiot Thanks a lot. I mean it . Both 😄
LOL! Excellent. Glad that was easy to fix. My bad too for not reading the original code a bit closer. :p