truffle-hdwallet-provider
truffle-hdwallet-provider copied to clipboard
Error: Invalid JSON RPC response: ""
Error: Invalid JSON RPC response: ""
4|bwcoin_p | at Object.InvalidResponse (/var/www/xxx/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
4|bwcoin_p | at XMLHttpRequest.request.onreadystatechange (/var/www/xxx/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
4|bwcoin_p | at XMLHttpRequestEventTarget.dispatchEvent (/var/www/bwcoin/node_modules/xhr2/lib/xhr2.js:64:18)
4|bwcoin_p | at XMLHttpRequest._setReadyState (/var/www/bwcoin/node_modules/xhr2/lib/xhr2.js:354:12)
4|bwcoin_p | at XMLHttpRequest._onHttpResponseEnd (/var/www/bwcoin/node_modules/xhr2/lib/xhr2.js:509:12)
4|bwcoin_p | at IncomingMessage.
I am minting tokens using hdwallet-provider and infura, but i am receiving this issue. How can I avoid this interruption?
I solved this problem by correcting the url set in HDWalletProvider in truffle.js file. If any one of HDWalletProvider has wrong url, the error occurs. I hope this works for you too.
will infura endpoint expire ? how to verify if the infura link is still valid
got same problems, seems not the issue about truffle.js urls. Any clue?
I was getting this error too, and it seemed to be because the eth node was not available via the url I provided.
At the end of the HDWalletProvider
constructor:
this.engine.start(); // Required by the provider engine.
https://github.com/trufflesuite/truffle-hdwallet-provider/blob/master/index.js#L46
This kicks of some polling via setInterval
where it starts polling for blocks and actually connecting to the blockchain. Its here that the problem seemed to occur.
Not to sound to critical of the authors of this fantastic project, but I don't think its not a good practice to be kicking off async stuff like this in a constructor.
It'd be nice if the pattern was more like:
const walletProvider = new HDWalletProvider...
walletProvider.testConnnection() // or some way to check it where Errors can actually be caught
walletProvider.startPolling()
Getting this issue all the time. Using Infura, node, no truffle. Seems a timeout issue. Impossible to catch :(
@zachlysobey Hello, i just wonder, why they need to start pooling at all? for example, if i just using infura url as provider for web3, web3 will send request to enfura when i will ask for it, getBalance, or deploy smart contract etc. And i will not receive this error.
Faced the same issue. Getting this error when trying to run the write function on Ropsten-Infura testnet. Can anyone please suggest some solution to this. Its urgent. Thanks in advance. Read Functions are running fine.
anyone found the solution yet? I use truffle with kovan infura
catch crash, retry .. I know, it's that sad
On Wed, Aug 22, 2018 at 7:04 PM haidoan [email protected] wrote:
anyone found the solution yet? I use truffle with kovan infura
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/trufflesuite/truffle-hdwallet-provider/issues/14#issuecomment-415105256, or mute the thread https://github.com/notifications/unsubscribe-auth/AeC1eAnIKEHXOhIcfEfmkCSql-m52ndZks5uTY8ogaJpZM4SJP7r .
Gonna see if I can dig into the providers and stop the polling
Any update on this
If anyone wants to stop polling, use hdWalletProvider.engine.stop()
Make sure the link/URL to the blockchain you are sending messages too is valid as well. That was my issue. Once I corrected it, it worked. (I had the wrong Infura security token)