Can't connect to dappnode via RPC URL

Hi. I was told that I can connect to my node via the http://geth.dappnode:8545 address.

The script I’m using calls for a JSONRPC URL to be able to connect to the node.

I’m running the script from the dappnode itself.

I’m getting this error. It looks like the script can’t connect to the node locally?

node:853719) UnhandledPromiseRejectionWarning: Error: invalid response - 0
at exports.XMLHttpRequest.request.onreadystatechange (/home/dappnode/.npm/_npx/853719/lib/node_modules/gastoken-miner/node_modules/ethers/utils/web.js:84:29)
at exports.XMLHttpRequest.dispatchEvent (/home/dappnode/.npm/_npx/853719/lib/node_modules/gastoken-miner/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/home/dappnode/.npm/_npx/853719/lib/node_modules/gastoken-miner/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at exports.XMLHttpRequest.handleError (/home/dappnode/.npm/_npx/853719/lib/node_modules/gastoken-miner/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
at ClientRequest.errorHandler (/home/dappnode/.npm/_npx/853719/lib/node_modules/gastoken-miner/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)
at ClientRequest.emit (events.js:198:13)
at Socket.socketErrorListener (_http_client.js:401:9)
at Socket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:853719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:853719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

You can’t access the RPC from the dappnode itself

Thanks for the gas token miner, i have to use infura rather than my own node?

is that correct? Thanks.

Also, I tried to access the dappnode from another machine on my network using that address. I received the same promise error.

Is there a different address that I should be using?

You can dockerize your gas minner in the same network of the DAppNode and point to it from there:
Use this commands to inspect the DAppNode Network (the network name and the hosts ips):
$: docker network ls
$: docker network inspect networkname

And when you create the docker from the image, specify the network and if you can even create a DAppNode Package it would be awesome :heart_eyes:

Okay. I’ll try that out.

If I can run it as a package, that would also solve some issues with manually running the miner. :).

I’ll need to investigate if I can call the eth gas station API to have it run when gas < a certain level. That would make it even more useful.