2

Does anybody know how to get the Ethereum Test RPC to work on Cloud9? I can run truffle serve and see the result on port 8080. But when I try testrpc -p 8081, my truffle application can't access testrpc. I have also configured my truffle app.json to point to 8081 instead of the default 8545.

Edit: When I try netstat -tulpn as @Justin suggested, I get the following:

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      2926/python     
tcp6       0      0 :::8080                 :::*                    LISTEN      2906/node       
tcp6       0      0 :::22                   :::*                    LISTEN      -

Edit: Ok, here is my new attempt at this:

  1. testrpc --port 8081 --domain 0.0.0.0
    This seems to properly start the testrpc client on the public interface
  2. Update the app.json to contain
    "rpc": { "host": "localhost", "port": 8081 }
  3. truffle deploy
  4. Update the app.json to contain
    "rpc": { "host": "project-user.c9users.io", "port": 8081 }
  5. truffle serve
  6. Open browser to http://project-user.c9users.io
  7. Receive JavaScript error Uncaught Error: CONNECTION ERROR: Couldn't connect to node http://project-user.c9users.io:8081.

The new 'netstat -tulpn' returns:

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      1194/python     
tcp6       0      0 :::8080                 :::*                    LISTEN      1581/node       
tcp6       0      0 :::22                   :::*                    LISTEN      -

Edit: I ran Wireshark on the browser communication and am getting this back when the JavaScript tries to communicate with testrpc. I get a 302 Moved Temporarily with location https://c9users.io:8081/_user_content/authorize?redirect=http%3A%2F%2Fproject-user.c9users.io%2F. This issue seems to have gone unresolved at https://community.c9.io/t/url-to-running-code-gets-stuck-on-authentication/142.

7
  • Are you trying to access port 8080/8081 from inside of the workspace? or from your local machine? Also, make sure your application is listening on that port with netstat -tulpn
    – Justin
    Dec 3, 2015 at 10:46
  • When I try netstat -tulpn I get this back: (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:8081 0.0.0.0:* LISTEN 2926/python tcp6 0 0 :::8080 :::* LISTEN 2906/node tcp6 0 0 :::22 :::* LISTEN -
    – jnwood
    Dec 3, 2015 at 20:20
  • I am trying to access testrpc listening to port 8081 from the client-side javascript of a node application that is listening to port 8080.
    – jnwood
    Dec 3, 2015 at 20:34
  • I believe the answer to my question may be the same as stackoverflow.com/questions/11297875/…. However, that question hasn't really received a definitive answer either. In any case, I have already tried both suggestions from the top answer there.
    – jnwood
    Dec 7, 2015 at 15:15
  • Your program is listening on 127.0.0.1:8081 instead of 0.0.0.0:8081 (:::8081 may show up, it's the same, but ipv6 syntax); so it is only accessible via localhost. c9 proxies the requests via a domain, so it is external to the machine running the code. Once you fix that it should work.
    – Justin
    Dec 9, 2015 at 10:18

1 Answer 1

1

This is a bug with Cloud9. This was answered at XMLHttpRequest cannot load cloud 9 io.

This is a temporary bug that arose as a result of changing the app preview URL from c9.io to c9users.io. The change was made in order to protect users and increase security. A fix will be out for this soon.

In the meantime you can set your application to public (your code will still be private and undiscoverable) by clicking "Share" in the top right and then checking the box next to your application URL.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.