Timeline for How to catch bad web3 eth node endpoint
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 22, 2020 at 13:55 | comment | added | Conviley |
@Ismael Thanks for pointing me in this direction! I ended up using axios to make a post request to the supplied endpoint, sending a JSON-RPC request calling the eth_blockNumber and use that as validation that the supplied infura enpoint is working! Feel free to make an answer and I can accept it! :)
|
|
Sep 19, 2020 at 15:21 | comment | added | Ismael♦ | That looks like a bug with web3 or HDWalletProvider. The other options will be to make a JSON-RPC query to provided URL, see the format expected eth.wiki/json-rpc/API#eth_blocknumber. | |
Sep 19, 2020 at 10:00 | comment | added | Conviley |
@Ismael tried a web3.eth.getBlockNumber() right after web3 initialization but page still crashes, If i make it an async function and put await before the getBlockNumber it does enter the catch statment but page also crashes
|
|
Sep 18, 2020 at 21:26 | comment | added | Ismael♦ |
Did you try making a call to web3 immediately? For example getBlock("latest") .
|
|
Sep 18, 2020 at 20:31 | history | asked | Conviley | CC BY-SA 4.0 |