menu
Channels
# All channels
view-forward
# Announcements
view-forward
# App development
view-forward
# Aragon Agent
view-forward
# Aragon Client
view-forward
# Aragon Connect
view-forward
# aragonOS
view-forward
# aragonUI
view-forward
# Feature requests
view-forward
Team

Connecting to ethereum node with Aragon CLI

March 21, 2020 at 12:17pm

Connecting to ethereum node with Aragon CLI

March 21, 2020 at 12:17pm
Apparently it's not possible anymore to use wss://mainnet.eth.aragon.network/ws. I tried with both 7.0.3 and 7.1.2:
$ dao apps governance.aragonid.eth --all --environment aragon:mainnet
⚠ You are currently using the Aragon Ethereum node (wss://mainnet.eth.aragon.network/ws) the request could take a while. Consider switching to Infura (https://infura.io) for better performances. See the "wsRPC" field of https://hack.aragon.org/docs/cli-global-confg for more information.
⠼ Inspecting DAO
✔ Inspecting DAO
✖ Fetching permissionless apps
→ Invalid JSON RPC response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.17.6</center>\r\n</body>\r\n</html>\r\n"
✖ Invalid JSON RPC response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.17.6</center>\r\n</body>\r\n</html>\r\n"
I tried to follow the article mentioned in the warning message (https://hack.aragon.org/docs/cli-global-confg), but it's not helpful. First, it does not specify where one must put the arapp.json file. From the source code I learned that aragon-cli looks in the current directory and then up the directory tree. So I put the arapp.json into my home directory and copied its contents from the provided example. But then I got the following error:
$ dao apps governance.aragonid.eth --all --environment aragon:mainnet
/usr/lib/node_modules/@aragon/cli/src/lib/environment/loadConfigFiles.js:60
throw Error(
^
Error: Error parsing arapp.json:
arapp.environments['aragon:local'] should have required property 'appName'
arapp.environments['aragon:rinkeby'] should have required property 'appName'
arapp.environments['aragon:staging'] should have required property 'appName'
arapp.environments['aragon:mainnet'] should have required property 'appName'
at Error (/usr/lib/node_modules/@aragon/cli/src/lib/environment/loadConfigFiles.js:60:11)
at configCliMiddleware (/usr/lib/node_modules/@aragon/cli/src/middleware/index.js:23:19)
at middlewares.reduce (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/lib/middleware.js:56:24)
at Array.reduce (<anonymous>)
at applyMiddleware (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/lib/middleware.js:42:6)
at Object.runCommand (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/lib/command.js:235:19)
at Object.parseArgs [as _parseArgs] (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/yargs.js:1107:41)
at Object.runCommand (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/lib/command.js:198:30)
at Object.parseArgs [as _parseArgs] (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/yargs.js:1107:41)
at Object.get [as argv] (/usr/lib/node_modules/@aragon/cli/node_modules/yargs/yargs.js:1041:21)
at Object.argv (/usr/lib/node_modules/@aragon/cli/src/index.js:4:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

March 21, 2020 at 12:56pm
Yes... we've had to do a lot of rate limiting and throttling on wss://mainnet.eth.aragon.network/ws because it was an open node and we had abuse :(
  • reply
  • like
I believe you should be able to use --wsRpc with another node (e.g. Infura).
  • reply
  • like
Unfortunately this option is not supported:
$ dao apps governance.aragonid.eth --all --environment aragon:mainnet --wsRpc ws://127.0.0.1:8546
✖ Unknown argument: wsRpc
  • reply
  • like
You are right, we miss the wsRPC option. One workaround is using the command under an Aragon repo and configures the arapp.json mainnet environment like:
"mainnet": {
"registry": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
"appName": "test.open.aragonpm.eth",
"wsRPC": "wss://mainnet.infura.io/ws/v3/<INFURA_KEY>",
"network": "mainnet"
}
Edited
  • reply
  • like
About the error with appName I reviewed and we forgot to include the appName options on the example. I update the docs with the change.
like-fill
2
  • reply
  • like
You are right, we miss the wsRPC option.
This sounds like something we should prioritize and make another release soon, given that most mainnet users will want to an easy way to specify this in the near term.
Edited
  • reply
  • like

March 22, 2020 at 6:23pm
Thanks . I added appName parameter to arapp.json as you suggested and aragon CLI picked it up. But I think that wsRPC parameter is ignored because CLI is still freezing and throwing errors like this:
→ Invalid JSON RPC response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.17.6</center>\r\n</body>\r\n</html>\r\n"
This happens with both Infura gateway and my local node, and my local node is certainly not running behind nginx proxy. Another downside is that arapp.json config doesn't work without truffle.js file:
/usr/lib/node_modules/@aragon/cli/src/helpers/truffle-config.js:22
throw new Error(`Didn't find any truffle.js file`)
^
Error: Didn't find any truffle.js file
  • reply
  • like
I'm surprised that you have the nginx error locally. Can you post the command that you tried? Please make sure that you don't add the aragon: prefix to the environment parameter if you're using an arapp.json file for rinkeby and mainnet. (e.g. --environment mainnet and not --environment aragon:mainnet)
Edited
  • reply
  • like
I can't re-test with my local node config right now, but here's a full log for the dao apps command with Infura config:
$ dao apps governance.aragonid.eth --all --environment mainnet --debug
❯ aragonCLI version: 7.1.2
❯ argv: ["/usr/bin/node","/usr/bin/aragon","dao","apps","governance.aragonid.eth","--all","--environment","mainnet","--debug"]
Inspecting DAO [started]
→ Fetching apps for governance.aragonid.eth...
Redefining LocalForage driver: memoryStorageDriver
Inspecting DAO [completed]
Fetching permissionless apps [started]
Fetching permissionless apps [failed]
→ Invalid JSON RPC response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.17.6</center>\r\n</body>\r\n</html>\r\n"
✖ Error: Invalid JSON RPC response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.17.6</center>\r\n</body>\r\n</html>\r\n"
at Object.InvalidResponse (./node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (./node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (./node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (./node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (./node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage.<anonymous> (./node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
What's interesting is that Infura dashboard shows the incoming calls. It looks like some calls go according to the wsRPC parameter but then at some point aragon CLI falls back to default Aragon ETH gateway and finishes with JSON RPC error.
  • reply
  • like
I tested the command a few times and I can reproduce this bug. Using a previous version of the CLI or the infura endpoint doesn't seem to solve the problem. Thanks for reporting this Kirill, we will try to publish a fix this week.
like-fill
2
  • reply
  • like
One thing I've noticed is that the command is working without the --all parameter, if this can help you while we work on the fix.
Edited
  • reply
  • like