2

I am trying to run Parity UI on Amazon EC2 instance to be accessible on external IPv4 address, but failing miserably with this attempt. I think I tried all the startup options it provides but couldn't make it work:

./parity --jsonrpc-interface all --signer-interface 0.0.0.0 --signer-no-validation --dapps-interface 0.0.0.0 --dapps-hosts all --chain parity-spec.json

I either get redirected to URL with 0.0.0.0 in a browser or it goes into an endless loop of below calls:

status.js:54 GET http://127.0.0.1:8080/api/ping net::ERR_CONNECTION_REFUSED

Has anybody tried to achieve this before?

7
  • Do you have your AWS port forwarding rules set up correctly? Commented Jan 17, 2017 at 16:44
  • For testing period I just set all the incoming connections to all ports to be allowed for this EC2 instance. But the problem is - Parity UI is forcefully switches the URL in a browser to use localhost interface and if it is not doing so, I can see it is still unable ot communicate to backend as status.js file in a browser is constantly sending /api/ping requests to 127.0.0.1:8080 which in a WAN is of course not working.
    – Artur
    Commented Jan 19, 2017 at 7:08
  • It's pretty hacky, but you could try using iptables to route 127.0.0.1 to the correct address Commented Jan 19, 2017 at 17:25
  • If you are talking about using iptables rules on the server with Parity, then this won't help, since 127.0.0.1 is being called from client browser itself and it is being run not on the same host with Parity, so it won't even reach the server with parity to let iptables do the routing job.
    – Artur
    Commented Jan 20, 2017 at 8:47
  • I meant to use it on the client Commented Jan 21, 2017 at 15:34

1 Answer 1

6

Remote Access to the Parity Wallet (Parity UI) is explained in detail in the Wallet Remote Access section of the Parity docs.

Before trying any method it is important to first make sure that the time on both machines is in sync by going to http://time.is/

enter image description here

Now you have a few options:

The recommended way is using SSH Tunneling

  1. Setup SSH server on the Host
  2. Run Parity without any flags (the default interface/port/cors/hosts settings will be sufficient)
  3. On the Client connect to your Host with port forwarding and keep the session running

    $ ssh -L 8080:127.0.0.1:8080 -L 8180:127.0.0.1:8180 <user>@<host> -vv

  4. To access Parity Wallet on the Client open a browser and type in authorization token, or open

    $ open http://127.0.0.1:8180/#/auth/<token>

  5. To generate a new token on the Host:

    $ parity signer new-token

Alternatively you can Expose the UI using Nginx

NOTE: It's recommended to setup authentication and SSL on your nginx server.

  1. Setup Nginx server on the Host.
  2. Create nginx configuration at /etc/nginx/sites-enabled/parity.ui

substitute <external-ip> with correct values:

server {
 listen <external-ip>:8080;

 # Uncomment for SSL Server
 #listen <external-ip>:8080 ssl;
 #ssl on;
 #ssl_certificate /etc/nginx/parity.ui.crt;
 #ssl_certificate_key /etc/nginx/parity.ui.key;

 location / {
   proxy_pass http://127.0.0.1:8080;
 }
}

server {
 listen <external-ip>:8180;

 # Uncomment for SSL Server
 #listen <external-ip>:8180 ssl;
 #ssl on;
 #ssl_certificate /etc/nginx/parity.ui.crt;
 #ssl_certificate_key /etc/nginx/parity.ui.key;

 location / {
   proxy_pass http://127.0.0.1:8180;

   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
   proxy_read_timeout 86400;
 }
}
  1. Restart nginx and run Parity without any flags (default interface/port/cors/hosts settings are sufficient)
  2. On the Client, open your browser and go to:

    $ open http://<external-ip>:8180/#/auth/<token>

  3. To generate a new token on the Host:

    $ parity signer new-token

The least secure method is to Directly expose to external connections.

This doesn't require SSH tunnels. It exposes your node RPC to external connections and if you really need to use it it is highly advised to configure very strict firewall rules and use it read-only, otherwise your password are being sent unencrypted over the network. This method is not recommended in general anyway, be warned.

  1. Figure out interface address you will use to access the Wallet-IP of the server (if you want the Wallet to be available on multiple interfaces see the note below)
  2. Run Parity on the Host, with the following flags:

    $ parity --dapps-interface <IP> --ui-interface <Wallet>

  3. On the Client, open your browser and go to:

    $ open http://<IP>:8180/#/auth/<token>

  4. To generate a new token on the Host:

    $ parity signer new-token

NOTE: Parity will accept only connections coming to correct interface (IP), if you want to listen on multiple interfaces (IP=0.0.0.0; again - not recommended) you need to run with additional flags like: --dapps-hosts and --ui-no-validation

3
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – q9f
    Commented Jun 9, 2017 at 10:07
  • Just an update as I stumbled upon this answer today, I just installed Parity 1.8 from scratch and decided to use the SSH port forwarding - it didn't work for me though and I discovered (I saw websockets complaining in chrome debugger) I also had to map port 8546 over the tunnel in addition to 8180
    – GregTheDev
    Commented Oct 21, 2017 at 19:13
  • Yes, instead of 8080 and 8180, we only need to tunnel 8546 (for WS)
    – ulu
    Commented Aug 12, 2018 at 13:39

Your Answer

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

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