6

I'm new to ethereum/parity and trying to follow this PoA setup demo as part of a larger project.

I've done it locally on my laptop, accessing resources via localhost. Now I'm trying to set up two separate nodes on two azure virtual machines and make them interact via internet.

Now my first question is - is this a sensible thing to do in the first place? Maybe I didn't grasp the architecture and these nodes shouldn't be exposed to the internet?

If this should work, I have the following problem - even a single node doesn't start properly.
I use docker container ethcore/parity:stable, this is my node0.toml file

[parity]
chain = "demo-spec.json"
base_path = "/tmp/parity0"
[network]
port = 30300
[rpc]
interface = "172.17.0.2"
hosts = ["172.17.0.2", "azure-vm-public-ip", "10.0.0.4"]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[ui]
interface = "172.17.0.2"
port = 8180
[dapps]
cors = "all"
hosts = ["azure-vm-public-ip", "10.0.0.4", "172.17.0.2"]
interface = "172.17.0.2"
port = 8080

I've added hosts and interfaces to the original file from demo (link above). Here azure-vm-public-ip is the IP I use to connect to the vm from my laptop. 10.0.0.4 is vm's local IP from $ ifconfig and 172.17.0.2 is IP that's seen from inside the docker container if you run $ifconfig.

demo-spec.json is exactly the same as in demo.

I run docker via this command, exposing all ports:

sudo docker run -ti --rm -p 30300:30300 -p 8080:8080 -p 8180:8180 -p 8540:8540 -v ~/demo-spec.json:/build/demo-spec.json -v ~/node0.toml:/build/node0.toml 65de5e38cf4b --config node0.toml

after startup public node URL is returned: enode://[email protected]:30300 which has docker's IP in it, not machine's IP and if I try to connect to http://azure-public-ip:8180/ from laptop I get

URL BLOCKED
YOU ARE NOT ALLOWED TO ACCESS TRUSTED SIGNER USING THIS URL.
Use: http://172.17.0.2:8180

and Blocked connection to Signer API from untrusted origin is written in parity log.

If I make a second connection to the vm and run $ curl http://172.17.0.2:8180 a proper html is returned, but $ curl http://localhost:8180 gives the same error.

If I change interface to 10.0.0.4 or azure-public-ip, parity doesn't start with the following error: RPC io error: Cannot assign requested address (os error 99)

So there seems to be a network setup misconfiguration, but I can't figure out where it is. Please advise.

2 Answers 2

3

You need to map the external/public IP of your VM to its internal interface.

You can use curl ifconfig.co or curl -4 http://l2.io/ip to get the external ip of your machine and set it for your session sudo ifconfig eth0:0 $(curl ifconfig.co) up

be sure that you don't have --ui-no-validation option. Here's a reference https://github.com/paritytech/parity/issues/5522

2

From what I can tell, you're using two internal ip spaces. They will not talk to each other unless its on the same network. You should bind the public ip or replace the interface with interface star.star.star.star which will bind to all ip's on the host.

You can test once you restart by trying telnet to the port. Also, where you have azure-public-ip, use the actual ip vs the hostname.

1
  • Could you explain in more details how can I bind a public ip?
    – xaxa
    Commented Jun 2, 2017 at 8:36

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.